From eb96afee64436e886d409b39e1b3035de29b15fb Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 04 二月 2023 22:25:49 +0800
Subject: [PATCH] 连接池Druid支持新的配置connectTimeout和socketTimeout

---
 ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

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 7727051..f06465f 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
@@ -4,10 +4,8 @@
 import java.util.Collections;
 import java.util.List;
 import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.Signature;
 import org.aspectj.lang.annotation.Aspect;
 import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
 import org.aspectj.lang.reflect.MethodSignature;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -52,7 +50,6 @@
     @Before("@annotation(rateLimiter)")
     public void doBefore(JoinPoint point, RateLimiter rateLimiter) throws Throwable
     {
-        String key = rateLimiter.key();
         int time = rateLimiter.time();
         int count = rateLimiter.count();
 
@@ -63,9 +60,9 @@
             Long number = redisTemplate.execute(limitScript, keys, count, time);
             if (StringUtils.isNull(number) || number.intValue() > count)
             {
-                throw new ServiceException("访问过于频繁,请稍后再试");
+                throw new ServiceException("访问过于频繁,请稍候再试");
             }
-            log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), key);
+            log.info("限制请求'{}',当前请求'{}',缓存key'{}'", count, number.intValue(), combineKey);
         }
         catch (ServiceException e)
         {
@@ -73,7 +70,7 @@
         }
         catch (Exception e)
         {
-            throw new RuntimeException("服务器限流异常,请稍后再试");
+            throw new RuntimeException("服务器限流异常,请稍候再试");
         }
     }
 

--
Gitblit v1.9.2