fix some bug

This commit is contained in:
suwings 2018-04-02 23:23:20 +08:00
parent 57f1d3ee68
commit 7b703bfdd9
3 changed files with 11 additions and 10 deletions

4
app.js
View File

@ -128,8 +128,8 @@ app.use(session({
secret: UUID.v4(),
name: 'Mcserver_session',
cookie: {
maxAge: 10000 * 60 * 60 * 3
}, // 3 小时
maxAge: 1000 * 60 * 60 * 4
},
resave: true,
saveUninitialized: true,
}));

View File

@ -41,7 +41,7 @@ const counter = require('../core/counter');
module.exports.isMaster = (wsSession, notPermssionCounter) => {
if (wsSession.username) {
if (wsSession.username.substr(0, 1) == '#') {
if (wsSession.username.trim().substr(0, 1) == '#') {
return true;
}
}
@ -87,5 +87,4 @@ module.exports.isCanServer = (userName, serverName) => {
}
}
return false;
}
}

View File

@ -11,12 +11,14 @@ app.use(bodyParser.urlencoded({
}));
app.use(bodyParser.json());
var UUID = require('uuid');
app.use(session({
secret: 'IFM_session_wseccret',
secret: UUID.v4(),
name: 'IFM_session',
//1小时
cookie: {
maxAge: 10000 * 60 * 60
maxAge: 1000 * 60 * 60
},
resave: true,
saveUninitialized: true,
@ -31,9 +33,9 @@ app.post('/', function (req, res) {
var baseR = require('./controller/function');
var authR = require('./controller/auth');
process.on("uncaughtException", function (err) {
console.log('UncaughtException 机制错误报告:', err);
});
// process.on("uncaughtException", function (err) {
// console.log('UncaughtException 机制错误报告:', err);
// });
app.use('/fs_auth', authR);
//必须先进行登陆