Commit c052200d by chenjinjing

no message

parent a38a9f7b
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"dependencies": { "dependencies": {
"@alicloud/sms-sdk": "^1.1.6", "@alicloud/sms-sdk": "^1.1.6",
"@types/node": "^10.12.18", "@types/node": "^10.12.18",
"bson": "^6.1.0",
"compression": "^1.7.4", "compression": "^1.7.4",
"express": "^4.17.1", "express": "^4.17.1",
"express-async-handler": "^1.1.4", "express-async-handler": "^1.1.4",
...@@ -15,7 +16,7 @@ ...@@ -15,7 +16,7 @@
"lru-cache": "^4.1.5", "lru-cache": "^4.1.5",
"md5": "^2.2.1", "md5": "^2.2.1",
"moment": "^2.24.0", "moment": "^2.24.0",
"mongoose": "^5.4.0", "mongoose": "^7.6.0",
"mysql": "^2.18.1", "mysql": "^2.18.1",
"mysql2": "^3.6.0", "mysql2": "^3.6.0",
"node-xlsx": "^0.16.1", "node-xlsx": "^0.16.1",
......
...@@ -5,15 +5,21 @@ ...@@ -5,15 +5,21 @@
<path>127.0.0.1</path> <path>127.0.0.1</path>
<port>27017</port> <port>27017</port>
<w>1</w> <w>1</w>
<!-- <dataBase>baseDB</dataBase> --> <dataBase>baseDB</dataBase>
<dataBase>yfs</dataBase>
<wtimeoutMS>30000</wtimeoutMS> <wtimeoutMS>30000</wtimeoutMS>
</mongodb> </mongodb>
<mysqldb> <mysqldb>
<!-- 本地mysql配置 -->
<mysqlHost>192.168.0.105</mysqlHost> <mysqlHost>192.168.0.105</mysqlHost>
<mysqlPort>3306</mysqlPort> <mysqlPort>3306</mysqlPort>
<mysqlUser>root</mysqlUser> <mysqlUser>root</mysqlUser>
<mysqlPwd>123456</mysqlPwd> <mysqlPwd>123456</mysqlPwd>
<dataBase>yfs</dataBase> <dataBase>yfs</dataBase>.
<!-- 服务器mysql配置 -->
<!-- <mysqlHost>127.0.0.1</mysqlHost>
<mysqlPort>3306</mysqlPort>
<mysqlUser>root</mysqlUser>
<mysqlPwd>Yfs123456_</mysqlPwd>
<dataBase>yfs</dataBase> -->
</mysqldb> </mysqldb>
</config> </config>
const Sequelize =require('sequelize'); const Sequelize = require('sequelize');
export const TablesConfig = [ export const TablesConfig = [
{ {
......
...@@ -18,14 +18,13 @@ export async function initConfig() { ...@@ -18,14 +18,13 @@ export async function initConfig() {
systemConfig.port = parseInt(port[0]); systemConfig.port = parseInt(port[0]);
systemConfig.sign = sign[0]; systemConfig.sign = sign[0];
const MongoPath = mongodb[0].path[0]; const MongoPath = mongodb[0].path[0];
const MongoPort = mongodb[0].port[0]; const MongoPort = mongodb[0].port[0];
const MongoW = mongodb[0].w[0]; const MongoW = mongodb[0].w[0];
const MongoDataBase = mongodb[0].dataBase[0]; const MongoDataBase = mongodb[0].dataBase[0];
const MongoWtimeoutMS = mongodb[0].wtimeoutMS[0]; const MongoWtimeoutMS = mongodb[0].wtimeoutMS[0];
systemConfig.mongodbStr = analysisMongoConnectStr( MongoPath, MongoPort, MongoDataBase, MongoW, MongoWtimeoutMS); systemConfig.mongodbStr = analysisMongoConnectStr( MongoPath, MongoPort, MongoDataBase, MongoW, MongoWtimeoutMS);
if (mysqldb) { if (mysqldb) {
let dbConfigInfo = mysqldb[0]; let dbConfigInfo = mysqldb[0];
systemConfig.mysqldb = {host:'', port:0, user:'', pwd:'', dataBase:''}; systemConfig.mysqldb = {host:'', port:0, user:'', pwd:'', dataBase:''};
......
...@@ -12,7 +12,12 @@ export async function initMysqlDB() { ...@@ -12,7 +12,12 @@ export async function initMysqlDB() {
max:20, //最大连接对象的个数 max:20, //最大连接对象的个数
min:5, //最小连接对象的个数 min:5, //最小连接对象的个数
idle:1000 //最长等待时间,单位为毫秒 idle:1000 //最长等待时间,单位为毫秒
} },
timezone: '+08:00', //东八时区
dialectOptions: {
dateStrings: true,
typeCast: true
},
}); });
} }
......
...@@ -9,8 +9,8 @@ async function lanuch() { ...@@ -9,8 +9,8 @@ async function lanuch() {
/**初始化配置解析 */ /**初始化配置解析 */
await initConfig(); await initConfig();
/**初始化数据库 */ /**初始化数据库 */
await mongoDB.initDB(); // await mongoDB.initDB();
await initModel(); // await initModel();
/**初始化sql */ /**初始化sql */
await mysqlDB.initMysqlDB(); await mysqlDB.initMysqlDB();
await initMysqlModel(); await initMysqlModel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment