mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
添加 - isMaster 添加登录检查
This commit is contained in:
parent
7e1977a343
commit
8b8bf636be
@ -27,7 +27,7 @@ module.exports.randomString = randomString;
|
|||||||
|
|
||||||
module.exports.needLogin = (req, res, trueCallBack, falseCallBack) => {
|
module.exports.needLogin = (req, res, trueCallBack, falseCallBack) => {
|
||||||
let username = req.session['username'];
|
let username = req.session['username'];
|
||||||
if (req.session['login'] && loginedContainer.isLogined(req.sessionID)) {
|
if (req.session['login'] && loginedContainer.isLogined(req.sessionID, username)) {
|
||||||
if (req.session['login'] === true && username) {
|
if (req.session['login'] === true && username) {
|
||||||
trueCallBack && trueCallBack();
|
trueCallBack && trueCallBack();
|
||||||
return true;
|
return true;
|
||||||
@ -43,6 +43,9 @@ module.exports.isMaster = (wsSession, notPermssionCounter) => {
|
|||||||
if (!wsSession.username || typeof wsSession.username != 'string') {
|
if (!wsSession.username || typeof wsSession.username != 'string') {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!loginedContainer.isLogined(wsSession.sessionID, wsSession.username)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let username = wsSession.username.trim() || '';
|
let username = wsSession.username.trim() || '';
|
||||||
if (username) {
|
if (username) {
|
||||||
if (username.substr(0, 1) == '#') {
|
if (username.substr(0, 1) == '#') {
|
||||||
|
Loading…
Reference in New Issue
Block a user