mirror of
https://gitee.com/xiongmao1988/rax-medical.git
synced 2025-08-23 20:44:58 +08:00
接口500后重新连接数据库,待测试
This commit is contained in:
parent
e433811f1d
commit
d1be1673d9
|
@ -14,6 +14,7 @@ const getTable = () => app.post('/getaimedicine', function (req, res) {
|
|||
connection(database).query(m_get(table, Clause, order, start, end), function (error, results, fields) {
|
||||
if (error) {
|
||||
console.log(`${nowTime()} 错误:${JSON.stringify(error)}`);
|
||||
connection(database).connect();
|
||||
return res.status(500).send(error);
|
||||
} else {
|
||||
res.send(results);
|
||||
|
|
|
@ -14,6 +14,7 @@ const getTable = () => app.post('/getdoctormedicine', function (req, res) {
|
|||
connection(database).query(m_get(table, Clause, order, start, end), function (error, results, fields) {
|
||||
if (error) {
|
||||
console.log(`${nowTime()} 错误:${JSON.stringify(error)}`);
|
||||
connection(database).connect();
|
||||
return res.status(500).send(error);
|
||||
} else {
|
||||
res.send(results);
|
||||
|
|
|
@ -14,6 +14,7 @@ const getTable = () => app.post('/getfeature', function (req, res) {
|
|||
connection(database).query(m_get(table, Clause, order, start, end), function (error, results, fields) {
|
||||
if (error) {
|
||||
console.log(`${nowTime()} 错误:${JSON.stringify(error)}`);
|
||||
connection(database).connect();
|
||||
return res.status(500).send(error);
|
||||
} else {
|
||||
res.send(results);
|
||||
|
|
Loading…
Reference in New Issue
Block a user