|
@@ -54,8 +54,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static com.citu.framework.common.util.servlet.ServletUtils.getClientIP;
|
|
|
import static com.citu.framework.web.core.util.WebFrameworkUtils.getTerminal;
|
|
|
-import static com.citu.module.menduner.system.dal.redis.RedisKeyConstants.MDE_AUTH_USER_PWD_LOCK;
|
|
|
-import static com.citu.module.menduner.system.dal.redis.RedisKeyConstants.MDE_AUTH_USER_SMS_CODE_LOCK;
|
|
|
+import static com.citu.module.menduner.system.dal.redis.RedisKeyConstants.*;
|
|
|
import static com.citu.module.menduner.system.enums.ErrorCodeConstants.*;
|
|
|
|
|
|
/**
|
|
@@ -145,8 +144,21 @@ public class MdeAuthServiceImpl implements MdeAuthService {
|
|
|
// 校验账号是否存在
|
|
|
MdeUserDO user = userService.getUserByPhone(account);
|
|
|
if (null == user) {
|
|
|
+ String num =
|
|
|
+ redisTemplate.opsForValue()
|
|
|
+ .get(String.format(MDE_AUTH_USER_PHONE_ENUM, account));
|
|
|
+ Integer numInt = Integer.parseInt(null == num ? "0" : num) + 1;
|
|
|
+
|
|
|
+ redisTemplate.opsForValue()
|
|
|
+ .set(String.format(MDE_AUTH_USER_PHONE_ENUM, account), String.valueOf(numInt), 8, TimeUnit.HOURS);
|
|
|
+
|
|
|
createLoginLog(null, account, logTypeEnum, LoginResultEnum.BAD_CREDENTIALS);
|
|
|
- throw exception(MDE_USER_MOBILE_NOT_EXISTS);
|
|
|
+ if (numInt >= 5) {
|
|
|
+ // 8个小时内输错5次 锁定
|
|
|
+ throw exception(MDE_USER_PHONE_NOT_EXISTS_ERROR);
|
|
|
+ } else {
|
|
|
+ throw exception(MDE_USER_MOBILE_NOT_EXISTS);
|
|
|
+ }
|
|
|
}
|
|
|
// 校验是否禁用
|
|
|
if (ObjectUtil.notEqual(user.getStatus(), MendunerStatusEnum.ENABLE.getStatus())) {
|