2023-11-10 17:45:10 +08:00
|
|
|
|
|
|
|
import bodyParser from "body-parser";
|
|
|
|
// 解决跨域
|
|
|
|
import cors from "cors";
|
|
|
|
import common from "./core/common.js";
|
|
|
|
import featureTable from "./core/featureTable.js";
|
|
|
|
import AIMedicineTable from "./core/AIMedicineTable.js";
|
|
|
|
import doctorMedicineTable from "./core/doctorMedicineTable.js";
|
2023-11-16 11:10:54 +08:00
|
|
|
import AIFlagTable from "./core/AIFlagTable.js";
|
2023-11-10 17:45:10 +08:00
|
|
|
|
|
|
|
const app = common.app;
|
|
|
|
const nowTime = common.nowTime;
|
|
|
|
|
|
|
|
//配置ajax跨域请求
|
|
|
|
app.use(cors({
|
|
|
|
origin: "*",
|
|
|
|
credentials: true //每次登陆都验证跨域请求,要不会每次报跨域错误
|
|
|
|
}));
|
|
|
|
// 配置 bodyParser
|
|
|
|
app.use(bodyParser.urlencoded({ extended: false }));
|
|
|
|
app.use(bodyParser.json());
|
|
|
|
|
|
|
|
app.listen(3001, () => console.log('服务启动! ' + nowTime()));
|
|
|
|
|
2023-11-27 18:28:07 +08:00
|
|
|
common.con.connect()
|
|
|
|
setInterval(() => {
|
|
|
|
common.con.connect()
|
|
|
|
}, 1000 * 60 * 60)
|
|
|
|
// common.con.query("SHOW DATABASES", function (error, results, fields) {
|
|
|
|
// if (error) {
|
|
|
|
// console.log(`${nowTime()} 错误:${JSON.stringify(error)}`);
|
|
|
|
// } else {
|
|
|
|
// common.connection(results[results.length-1].Database).connect();
|
|
|
|
// }
|
|
|
|
// });
|
2023-11-21 10:20:10 +08:00
|
|
|
|
2023-11-14 09:49:00 +08:00
|
|
|
common.getDatabases();
|
2023-11-10 17:45:10 +08:00
|
|
|
featureTable.getTable();
|
|
|
|
AIMedicineTable.getTable();
|
|
|
|
doctorMedicineTable.getTable();
|
2023-11-16 11:10:54 +08:00
|
|
|
AIFlagTable.getTable();
|
|
|
|
|
2023-11-11 13:22:51 +08:00
|
|
|
AIMedicineTable.addTable();
|
|
|
|
doctorMedicineTable.addTable();
|
2023-11-16 11:10:54 +08:00
|
|
|
AIFlagTable.addTable();
|
2023-11-10 17:45:10 +08:00
|
|
|
|
|
|
|
// MedicineFeadbackInfoTable
|
|
|
|
// TimingFeadbackInfoTable
|