This commit is contained in:
77
2024-04-26 00:53:31 +08:00
parent d771783812
commit 8138f6dee0
7 changed files with 95 additions and 2 deletions

View File

@@ -122,6 +122,9 @@ public class CaiLoginManager {
if(!BCrypt.checkpw(password, user.getPassword())){
RAtomicLong atomicLong = redissonClient.getAtomicLong(key);
Long passwordMaxNum = systemConfigManager.getSystemConfigOfLong(SystemConfigEnum.LOGIN_PASSWORD_ERROR_MAX_NUM);
if(passwordMaxNum <= 0){
throw new ServiceException("用户不存在或密码错误");
}
long num = atomicLong.incrementAndGet();
if(num >= passwordMaxNum){
String error = String.format("密码错误次数超过%s次账号已被封禁请联系客服解锁", passwordMaxNum);