😎调整密码错误次数最大为10次
This commit is contained in:
parent
e0a43dbe99
commit
944e372e1e
@ -66,9 +66,9 @@ public class SysAuthService : IDynamicApiController, ITransient
|
||||
var keyPasswordErrorTimes = $"{CacheConst.KeyPasswordErrorTimes}{input.Account}";
|
||||
var passwordErrorTimes = _sysCacheService.Get<int>(keyPasswordErrorTimes);
|
||||
var passwordMaxErrorTimes = await _sysConfigService.GetConfigValue<int>(ConfigConst.SysPasswordMaxErrorTimes);
|
||||
// 若未配置或误配置为0、负数, 则正确密码也无法登录
|
||||
// 若未配置或误配置为0、负数, 则默认密码错误次数最大为10次
|
||||
if (passwordMaxErrorTimes < 1)
|
||||
passwordMaxErrorTimes = 1;
|
||||
passwordMaxErrorTimes = 10;
|
||||
if (passwordErrorTimes > passwordMaxErrorTimes)
|
||||
throw Oops.Oh(ErrorCodeEnum.D1027);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user