明树Git Lab

Commit 47bb4647 authored by zfp1's avatar zfp1

update

parent 1d6b5e7c
Pipeline #102338 failed with stages
{ {
"tokenEx": 86400000000, "tokenEx": 86400000000,
"dbURI": "mongodb://127.0.0.1:27017/letian?authSource=admin",
"file": { "file": {
"storagePath": "/uploadfiles" "storagePath": "/uploadfiles"
}, },
...@@ -11,18 +10,9 @@ ...@@ -11,18 +10,9 @@
"port": 3306, "port": 3306,
"username": "root", "username": "root",
"password": "123456", "password": "123456",
"database": "test", "database": "gzbjt",
"logging": true "logging": true
}, },
"dmdb": {
"host": "localhost",
"port": 5236,
"username": "SYSDBA",
"password": "SYSDBA",
"database": "letian",
"logging": true,
"connectString": "dm://SYSDBA:SYSDBA@localhost:5236"
},
"redis": { "redis": {
"host": "localhost", "host": "localhost",
"port": 6379, "port": 6379,
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
const { Sequelize } = require('sequelize'); const { Sequelize } = require('sequelize');
// 创建 Sequelize 实例,连接数据库 // 创建 Sequelize 实例,连接数据库
const sequelize = new Sequelize('gzbjt', 'root', '123456', { const sequelize = new Sequelize(sysConfig.database || 'gzbjt', sysConfig.username || 'root', sysConfig.password ||'123456', {
host: 'localhost', host: sysConfig.host || 'localhost',
dialect: 'mysql', dialect: 'mysql',
logging: console.log, // 显示日志(可选) logging: console.log, // 显示日志(可选)
pool: { pool: {
......
...@@ -60,7 +60,7 @@ const RequestLog = sequelize.define('User', { ...@@ -60,7 +60,7 @@ const RequestLog = sequelize.define('User', {
}); });
// 同步模型到数据库(创建表) // 同步模型到数据库(创建表)
RequestLog.sync({ force: true }) // force: true 会删除已存在表并重新创建 RequestLog.sync({ force: false }) // force: true 会删除已存在表并重新创建
.then(() => { .then(() => {
console.log('RequestLog 表同步成功'); console.log('RequestLog 表同步成功');
}); });
......
...@@ -38,7 +38,7 @@ module.exports = async (req, res, next) => { ...@@ -38,7 +38,7 @@ module.exports = async (req, res, next) => {
...req.params, ...req.params,
}), }),
reqId: req.reqId, reqId: req.reqId,
userId: req.user.id, userId: req.user && req.user.id,
user: JSON.stringify(req.user), user: JSON.stringify(req.user),
method: req.method, method: req.method,
headers: JSON.stringify(req.headers), headers: JSON.stringify(req.headers),
......
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