修改 - 优化代码

This commit is contained in:
suwings 2018-04-20 10:43:17 +08:00
parent 54a2e1f2df
commit ff0b66e93e
2 changed files with 2 additions and 1 deletions

2
app.js
View File

@ -134,7 +134,7 @@ app.use(session({
maxAge: 1000 * 60 * 60 * 4
},
resave: false,
saveUninitialized: true
saveUninitialized: false
}));
//使用 gzip 静态文本压缩,但是如果你使用反向代理或某 HTTP 服务自带的gzip请关闭它

View File

@ -18,6 +18,7 @@ const userManager = userCenter();
router.post('/loginout', function (req, res) {
MCSERVER.log('[loginout] 用户:' + req.session['username'] + '退出');
loginedContainer.delLogined(req.session['username']);
// BUG Note: Ws—close 与 Loginout 时 Session 可能不一定及时同步
// 导致我们暂时无法用一种很简单的方式来实现动态的更换 token
req.session['login'] = false;