|
@@ -40,8 +40,6 @@ public class LimitRequestAspect {
|
|
|
// 第一个参数是key, 第二个参数是默认值
|
|
|
ExpiringMap<String, Integer> map = book.getOrDefault(request.getRequestURI(), ExpiringMap.builder().variableExpiration().build());
|
|
|
Integer uCount = map.getOrDefault(request.getRemoteAddr(), 0);
|
|
|
-
|
|
|
-
|
|
|
if (uCount >= limitRequest.count()) { // 超过次数,不执行目标方法
|
|
|
//这里的返回对象类型根据controller方法的返回方式一致
|
|
|
httpRespMsg.setError(MessageUtils.message("request.countLimit"));
|