modify bug in db connectionLimit、login
This commit is contained in:
parent
4ca4ef1d62
commit
a69230d41f
@ -8,7 +8,7 @@ router.get("/", async function(req, res) {
|
|||||||
let conn;
|
let conn;
|
||||||
try {
|
try {
|
||||||
conn = await util.getDBConnection(); // get connection from db
|
conn = await util.getDBConnection(); // get connection from db
|
||||||
const query = ` //語法有問題
|
const query = `
|
||||||
SELECT
|
SELECT
|
||||||
item_form.application_id,
|
item_form.application_id,
|
||||||
item_form.item_info_id,
|
item_form.item_info_id,
|
||||||
@ -20,7 +20,7 @@ router.get("/", async function(req, res) {
|
|||||||
FROM
|
FROM
|
||||||
item_form
|
item_form
|
||||||
RIGHT JOIN
|
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
|
RIGHT JOIN
|
||||||
student ON scholarship_application.student_id = student.student_id;
|
student ON scholarship_application.student_id = student.student_id;
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -3,10 +3,11 @@ async function submit() {
|
|||||||
const password = document.getElementById("password").value;
|
const password = document.getElementById("password").value;
|
||||||
console.log(account, password);
|
console.log(account, password);
|
||||||
let data = {account : account, password : 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;
|
suc_login = suc_login.data;
|
||||||
console.log(suc_login);
|
console.log(suc_login);
|
||||||
if (suc_login.suc) {
|
if (suc_login.suc) {
|
||||||
|
|
||||||
location.href = '/main';
|
location.href = '/main';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const db = require("mariadb");
|
|||||||
|
|
||||||
// create pool
|
// create pool
|
||||||
const pool = db.createPool({
|
const pool = db.createPool({
|
||||||
connectionLimit : 500,
|
connectionLimit : 10,
|
||||||
host : 'localhost',
|
host : 'localhost',
|
||||||
user : 'root',
|
user : 'root',
|
||||||
password : '',
|
password : '',
|
||||||
|
|||||||
@ -4,7 +4,7 @@ const db = require("mariadb");
|
|||||||
|
|
||||||
// create pool
|
// create pool
|
||||||
const pool = db.createPool({
|
const pool = db.createPool({
|
||||||
connectionLimit : 500,
|
connectionLimit : 10,
|
||||||
host : 'localhost',
|
host : 'localhost',
|
||||||
user : 'user',
|
user : 'user',
|
||||||
password : '',
|
password : '',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user