Commit 96003026 by zt

修改redis key的条件判断

parent fda6bb53
...@@ -1023,7 +1023,7 @@ public class UserController { ...@@ -1023,7 +1023,7 @@ public class UserController {
int ipWithinSeconds = Integer.valueOf(PropertiesUtils.getProperties().get("ipWithinSeconds").toString()); int ipWithinSeconds = Integer.valueOf(PropertiesUtils.getProperties().get("ipWithinSeconds").toString());
int ipLimitTimes = Integer.valueOf(PropertiesUtils.getProperties().get("ipLimitTimes").toString()); int ipLimitTimes = Integer.valueOf(PropertiesUtils.getProperties().get("ipLimitTimes").toString());
//如果redis没有key //如果redis没有key
if (!redisUtils.exists(userIp, indexDb)) { if (redisUtils.get(userIp, indexDb) == null) {
redisUtils.set(userIp, 1, indexDb); redisUtils.set(userIp, 1, indexDb);
//设置过期时间 //设置过期时间
redisUtils.expire(userIp, ipWithinSeconds, indexDb); redisUtils.expire(userIp, ipWithinSeconds, 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