Commit 46b4e907 by zhangyu

登陆修改

parent 11be1cd4
...@@ -145,14 +145,17 @@ public class UserController { ...@@ -145,14 +145,17 @@ public class UserController {
LOG.debug("[UserController login][STATUS_CODE_4102]总共用时:" + Util.getDurationTime(duration)); LOG.debug("[UserController login][STATUS_CODE_4102]总共用时:" + Util.getDurationTime(duration));
return responseBean; return responseBean;
} }
String blackUsername= redisUtils.get("black_username:" + loginBean.getLoginName(), indexDb);
if (null != redisUsername && Integer.parseInt(redisUsername) >= 6) { if (null != redisUsername && Integer.parseInt(redisUsername) >= 5 && StringUtils.isEmpty(blackUsername) ) {
redisUtils.set("black_username:"+loginBean.getLoginName(), 1, indexDb); redisUtils.set("black_username:"+loginBean.getLoginName(), 1, indexDb);
redisUtils.expire("black_username:" + loginBean.getLoginName(), 300, indexDb); }else if (blackUsername!=null && Integer.parseInt(blackUsername) ==1){
redisUtils.incrNotResetExpireTime("black_username:"+loginBean.getLoginName(), indexDb);
redisUtils.expire("black_username:"+loginBean.getLoginName(), 300, indexDb);
}
if (blackUsername!=null){
responseBean.setStatus(ErrorCode.STATUS_CODE_4101); responseBean.setStatus(ErrorCode.STATUS_CODE_4101);
responseBean.setMessage("该帐号已禁止登录"); responseBean.setMessage("该帐号已禁止登录");
checkIpLimit(userIp); checkIpLimit(userIp);
return responseBean; return responseBean;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment