明树Git Lab

Commit 47bb4647 authored by zfp1's avatar zfp1

update

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