mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-08 12:39:05 +08:00
feat(auth): 优化登录失败次数统计逻辑
- 使用RedisUtils.increment替代原生Redis命令实现递增操作 - 简化代码结构并提升可读性
This commit is contained in:
1 parent
2d7d089fcd
commit
c0e9ed69be
1 file changed
+1
-3
+1
-3
@@ -134,9 +134,7 @@ public class PigxAuthenticationFailureEventHandler implements AuthenticationFail
|
||||
Long deltaTimes = ParamResolver.getLong("LOGIN_ERROR_TIMES", 5L);
|
||||
|
||||
// 使用 RedisUtils 执行原生 Redis 命令进行递增操作
|
||||
Long times = RedisUtils.execute(connection ->
|
||||
connection.incr(key.getBytes())
|
||||
);
|
||||
Long times = RedisUtils.increment(key, 1L);// 增加登录失败次数
|
||||
|
||||
// 自动过期时间
|
||||
Long deltaTime = ParamResolver.getLong("DELTA_TIME", 1L);
|
||||
|
||||
Reference in new issue
Block a user