feat(auth): 优化登录失败次数统计逻辑

- 使用RedisUtils.increment替代原生Redis命令实现递增操作
- 简化代码结构并提升可读性
This commit is contained in:
PIG AI committed 2025-07-05 09:00:34 +08:00
1 parent 2d7d089fcd
commit c0e9ed69be
1 file changed
+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);