String username = sysUser.getUsername();
String retryCountNum = redisService.get(username);
if(StrUtil.isNotBlank(retryCountNum) && Integer.valueOf(retryCountNum)>=5){
return R.failed("密码输错5次,已锁定,请30分钟后重试!");
}
//设置登录失败5次锁定30分钟标签:输错,valueOf,java,30,retryCountNum,密码,retryCount From: https://www.cnblogs.com/wjsqqj/p/17137862.html
//三十分钟
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次!");