diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtils.java index 3ae0fd44..7104b4d2 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/RedisUtils.java @@ -45,10 +45,10 @@ public class RedisUtils { } /** - * 获取实例id + * 获取客户端实例 */ - public static String getClientId() { - return CLIENT.getId(); + public static RedissonClient getClient() { + return CLIENT; } /** diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java index df4d9c87..ce3de2be 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java @@ -54,7 +54,7 @@ public class RateLimiterAspect { stringBuffer.append(ServletUtils.getClientIP()).append("-"); } else if (rateLimiter.limitType() == LimitType.CLUSTER){ // 获取客户端实例id - stringBuffer.append(RedisUtils.getClientId()).append("-"); + stringBuffer.append(RedisUtils.getClient().getId()).append("-"); } MethodSignature signature = (MethodSignature) point.getSignature(); Method method = signature.getMethod();