String username = sysUser.getUsername();
String retryCountNum = redisService.get(username);
if(StrUtil.isNotBlank(retryCountNum) && Integer.valueOf(retryCountNum)>=5){
return R.failed("密码输错5次,已锁定,请30分钟后重试!");
}
//设置登录失败5次锁定30分钟
//三十分钟
long isTime = 1800;
int retryCount = 1;
if(StrUtil.isNotBlank(retryCountNum)){
retryCount = Integer.valueOf(retryCountNum);
retryCount ++;
}
//设置该用户密码错误次数
redisService.setAndExpire(username, String.valueOf(retryCount), isTime);
return R.failed("用户名或密码错误,已输错"+retryCount+"次,请勿连续输错超过5次!");