|
|
@ -96,13 +96,12 @@ public class PassWordServiceImpl implements PassWordService { |
|
|
|
if (!configVO.isOnOff()) { |
|
|
|
return; |
|
|
|
} |
|
|
|
Long incr = redisCache.redisTemplate.opsForValue().increment(String.format(PASSWORD_RETRY_TIMES, loginName)); |
|
|
|
if (incr == 3) { |
|
|
|
redisCache.expire(String.format(PASSWORD_RETRY_TIMES, loginName), configVO.getLockMinutes(), TimeUnit.MINUTES); |
|
|
|
} |
|
|
|
if (incr > 3) { |
|
|
|
String key = String.format(PASSWORD_RETRY_TIMES, loginName); |
|
|
|
String times = redisCache.getCacheObject(key); |
|
|
|
if(!Util.isNullOrEmpty(times) && Integer.parseInt(times) == 3){ |
|
|
|
throw exception(PASSWORD_RETRY_TIMES_ERROR, configVO.getLockMinutes(), configVO.getTryCount(), LocalDateTime.now().plusMinutes(configVO.getLockMinutes()).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); |
|
|
|
} |
|
|
|
redisCache.incr(String.format(PASSWORD_RETRY_TIMES, loginName), configVO.getLockMinutes()*60); |
|
|
|
} |
|
|
|
@Override |
|
|
|
public void validateResetTime(LocalDateTime lastResetTime) { |
|
|
|