mirror of
https://github.com/MCSManager/MCSManager.git
synced 2025-01-24 15:14:01 +08:00
fix some bug
This commit is contained in:
parent
57f1d3ee68
commit
7b703bfdd9
4
app.js
4
app.js
@ -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,
|
||||
}));
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
@ -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);
|
||||
//必须先进行登陆
|
||||
|
Loading…
Reference in New Issue
Block a user