|
@@ -2,7 +2,8 @@ const mysql = require('mysql')
|
|
const fs = require("fs");
|
|
const fs = require("fs");
|
|
const configFile = fs.readFileSync('./config.json');
|
|
const configFile = fs.readFileSync('./config.json');
|
|
const globalConfig = JSON.parse(configFile)
|
|
const globalConfig = JSON.parse(configFile)
|
|
-const db_config = globalConfig['ship-test'].db
|
|
|
|
|
|
+const shipTestConfig = globalConfig['ship-test'][globalConfig['ship-test']['version']]
|
|
|
|
+const db_config = shipTestConfig.db
|
|
// 进行数据库交互
|
|
// 进行数据库交互
|
|
const sqlHandle = (sql, values) => {
|
|
const sqlHandle = (sql, values) => {
|
|
let connect = mysql.createConnection(db_config)
|
|
let connect = mysql.createConnection(db_config)
|