Commit 849888c1 by java-李谡

更改bug

parent 239c0628
......@@ -52,10 +52,6 @@ public class UserController {
private int ipWithinSeconds;
@Value("${redis.ipLimitTimes}")
private int ipLimitTimes;
@Value("${redis.userSealUpSeconds}")
private int userSealUpSeconds;
@Value("${redis.userOverdueSeconds}")
private int userOverdueSeconds;
@Value("${redis.usernameWithinSeconds}")
private int usernameWithinSeconds;
@Value("${redis.usernameLimitTimes}")
......@@ -161,10 +157,10 @@ public class UserController {
}
String blackUsername = redisUtils.get("black_username:" + loginBean.getLoginName(), indexDb);
boolean sealup = false;
if (null != redisUsername && Integer.parseInt(redisUsername) >= 5 && StringUtils.isEmpty(blackUsername)) {
if (null != redisUsername && Integer.parseInt(redisUsername) >= usernameLimitTimes && StringUtils.isEmpty(blackUsername)) {
System.out.println("加入黑名单");
redisUtils.set("black_username:" + loginBean.getLoginName(), 1, indexDb);
redisUtils.expire("black_username:" + loginBean.getLoginName(), userSealUpSeconds, indexDb);
redisUtils.expire("black_username:" + loginBean.getLoginName(), blackUsernameTime, indexDb);
sealup = true;
} else if (blackUsername != null) {
sealup = true;
......@@ -184,7 +180,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if (StringUtils.isEmpty(redisUsername)) {
redisUtils.set(loginBean.getLoginName(), 1, indexDb);
redisUtils.expire(loginBean.getLoginName(), userOverdueSeconds, indexDb);
redisUtils.expire(loginBean.getLoginName(), usernameWithinSeconds, indexDb);
} else {
redisUtils.incrNotResetExpireTime(loginBean.getLoginName(), indexDb);
}
......@@ -235,7 +231,7 @@ public class UserController {
if (StringUtils.isEmpty(redisUsername)) {
System.out.println("账户错误初始化");
redisUtils.set(loginBean.getLoginName(), 1, indexDb);
redisUtils.expire(loginBean.getLoginName(), userOverdueSeconds, indexDb);
redisUtils.expire(loginBean.getLoginName(), usernameWithinSeconds, indexDb);
} else {
System.out.println("账户错误加1");
redisUtils.incrNotResetExpireTime(loginBean.getLoginName(), indexDb);
......
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