密码连续错误次数判断位置修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
5d7a083f4a
commit
dd8e244e64
|
|
@ -1000,14 +1000,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var userLog = new UserLog();
|
||||
|
||||
if (failCount >= maxFailures)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.TempLockLogin }, true);
|
||||
|
||||
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
||||
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
||||
}
|
||||
|
||||
var userLoginReturnModel = new IRCLoginReturnDTO();
|
||||
|
||||
|
||||
|
|
@ -1019,7 +1011,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var isLoginUncommonly = false;
|
||||
|
||||
#region //登录用户是系统用户的时候,就要要记录异地登录
|
||||
#region 登录用户是系统用户的时候,就要要记录异地登录
|
||||
|
||||
//账号在系统存在
|
||||
if (isExistAccount || loginUser != null)
|
||||
|
|
@ -1093,6 +1085,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
//错误次数累加
|
||||
failCount++;
|
||||
|
||||
if (failCount >= maxFailures)
|
||||
{
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.TempLockLogin }, true);
|
||||
|
||||
//$"密码连续错误{maxFailures}次,当前账号已被限制登录,请等待 {lockoutMinutes} 分钟后再试。"
|
||||
throw new BusinessValidationFailedException(_localizer["User_ErrorLimit", maxFailures, lockoutMinutes]);
|
||||
}
|
||||
|
||||
await _fusionCache.SetAsync(cacheKey, failCount, TimeSpan.FromMinutes(lockoutMinutes));
|
||||
|
||||
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionUserName = userName, LoginPassword = password, OptType = UserOptType.AccountOrPasswordError, IsLoginUncommonly = isLoginUncommonly }, true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue