From c0e9ed69befc26b9f8ca8dee5e50e4bf17232577 Mon Sep 17 00:00:00 2001 From: PIG AI Date: Sat, 5 Jul 2025 09:00:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(auth):=20=E4=BC=98=E5=8C=96=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=A4=B1=E8=B4=A5=E6=AC=A1=E6=95=B0=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用RedisUtils.increment替代原生Redis命令实现递增操作 - 简化代码结构并提升可读性 --- .../handler/PigxAuthenticationFailureEventHandler.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/support/handler/PigxAuthenticationFailureEventHandler.java b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/support/handler/PigxAuthenticationFailureEventHandler.java index 092566fec..fbc22a940 100644 --- a/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/support/handler/PigxAuthenticationFailureEventHandler.java +++ b/pigx-auth/src/main/java/com/pig4cloud/pigx/auth/support/handler/PigxAuthenticationFailureEventHandler.java @@ -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);