...
|
...
|
@@ -56,8 +56,8 @@ passport.use('local', new LocalStrategy({ |
|
|
let account = req.body.account;
|
|
|
let type = req.body.loginType;
|
|
|
|
|
|
let errorLoginKey = 'account_errorlogin_' + account;
|
|
|
let accountKey = 'account_signin_' + account;
|
|
|
let errorLoginKey = 'account_errorlogin_' + clientIp;
|
|
|
let accountKey = 'account_signin_' + clientIp;
|
|
|
|
|
|
getLoginStat(account).then(times => {
|
|
|
let errLoginTimes = _.parseInt(times[0]) || 0;
|
...
|
...
|
@@ -76,7 +76,7 @@ passport.use('local', new LocalStrategy({ |
|
|
errLoginTimes = errLoginTimes + 1;
|
|
|
accountTimes = accountTimes + 1;
|
|
|
cache.set(errorLoginKey, errLoginTimes).catch(() => {});
|
|
|
cache.set(accountKey, accountTimes, 1800).catch(() => {});
|
|
|
cache.set(accountKey, accountTimes, 3600).catch(() => {});
|
|
|
|
|
|
// 再次校验
|
|
|
if (accountTimes >= 10) {
|
...
|
...
|
|