modify bug in db connectionLimit、login

This commit is contained in:
Chen,Hui Chen 2024-06-16 21:59:00 +08:00
parent 4ca4ef1d62
commit a69230d41f
4 changed files with 6 additions and 5 deletions

View File

@ -8,7 +8,7 @@ router.get("/", async function(req, res) {
let conn;
try {
conn = await util.getDBConnection(); // get connection from db
const query = ` //語法有問題
const query = `
SELECT
item_form.application_id,
item_form.item_info_id,
@ -20,7 +20,7 @@ router.get("/", async function(req, res) {
FROM
item_form
RIGHT JOIN
scholarship_application ON item_form.application_id = scholarship_application.application_id;
scholarship_application ON item_form.application_id = scholarship_application.application_id
RIGHT JOIN
student ON scholarship_application.student_id = student.student_id;
`;

View File

@ -3,10 +3,11 @@ async function submit() {
const password = document.getElementById("password").value;
console.log(account, password);
let data = {account : account, password : password};
let suc_login = await axios.post('/api/login', data);
let suc_login = await axios.post('http://163.22.17.184:5000/api/login', data);
suc_login = suc_login.data;
console.log(suc_login);
if (suc_login.suc) {
location.href = '/main';
}
else {

View File

@ -4,7 +4,7 @@ const db = require("mariadb");
// create pool
const pool = db.createPool({
connectionLimit : 500,
connectionLimit : 10,
host : 'localhost',
user : 'root',
password : '',

View File

@ -4,7 +4,7 @@ const db = require("mariadb");
// create pool
const pool = db.createPool({
connectionLimit : 500,
connectionLimit : 10,
host : 'localhost',
user : 'user',
password : '',