mirror of
https://github.com/MCSManager/MCSManager.git
synced 2024-11-21 03:12:10 +08:00
添加 - 禁止覆盖或重复登录
This commit is contained in:
parent
a8147634b5
commit
1de0a28ba7
@ -30,11 +30,22 @@ MCSERVER.login = function (username, password, rand, loginSuccess, loginError, e
|
||||
},
|
||||
success: function (data, textStatus) {
|
||||
var obj = JSON.parse(data);
|
||||
//后端指令操作
|
||||
if (typeof obj['ResponseValue'] == 'number') {
|
||||
var commande = Number.parseInt(obj['ResponseValue']);
|
||||
if (commande == 302) {
|
||||
alert("您已登录,不可重复或覆盖原先登录,我们将为你跳转网页....");
|
||||
window.location.href = '../';
|
||||
}
|
||||
return;
|
||||
}
|
||||
//后端警告操作
|
||||
if (typeof obj['ResponseValue'] == 'string') {
|
||||
alert(obj['ResponseValue']);
|
||||
loginError && loginError();
|
||||
return;
|
||||
}
|
||||
//后端正常操作,判断密码与账户
|
||||
if (obj['ResponseValue']) {
|
||||
loginSuccess && loginSuccess();
|
||||
} else {
|
||||
|
@ -76,6 +76,12 @@ router.post('/login', function (req, res) {
|
||||
return;
|
||||
}
|
||||
|
||||
//如果已经登录,则直接跳转
|
||||
if (req.session['login'] || req.session['username']) {
|
||||
response.returnMsg(res, 'login/check', 302);
|
||||
return;
|
||||
}
|
||||
|
||||
//登陆次数加一
|
||||
counter.plus('login');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user