疯狂的狮子li
2021-11-01 c4e17ff8472fd9f8123e86b593b2968ad5936b15
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java
@@ -37,13 +37,13 @@
            }
            long number = RedisUtils.rateLimiter(combineKey, rateType, count, time);
            if (number == -1) {
                throw new ServiceException("访问过于频繁,请稍后再试");
                throw new ServiceException("访问过于频繁,请稍候再试");
            }
            log.info("限制令牌 => {}, 剩余令牌 => {}, 缓存key => '{}'", count, number, combineKey);
        } catch (ServiceException e) {
            throw e;
        } catch (Exception e) {
            throw new RuntimeException("服务器限流异常,请稍后再试");
            throw new RuntimeException("服务器限流异常,请稍候再试");
        }
    }
@@ -62,5 +62,4 @@
        stringBuffer.append(targetClass.getName()).append("-").append(method.getName());
        return stringBuffer.toString();
    }
}