|
@@ -65,12 +65,6 @@ public class ValidateApiAOP {
|
|
|
}
|
|
|
//数据库鉴权
|
|
|
userAuthService.checkValidAppKey(authorization);
|
|
|
-
|
|
|
- //内存标记,减少redis访问
|
|
|
- Boolean over = localOverCache.getTimedCache(authorization);
|
|
|
- if (ObjectUtil.isNotNull(over) && over) {
|
|
|
- throw new ApiBusinessException(HttpStatus.COUNT_OVER, "");
|
|
|
- }
|
|
|
}
|
|
|
if (counting) {
|
|
|
//判断是否是无限制
|
|
@@ -80,7 +74,6 @@ public class ValidateApiAOP {
|
|
|
long decrStock = redisUtil.decr(String.format(RedisKey.API_METHOD_COUNT, authorization), 1);
|
|
|
log.info("前置减次数后,{}", decrStock);
|
|
|
if (decrStock < 0) {
|
|
|
- localOverCache.setTimedCache(authorization, true);
|
|
|
//次数用完后,redis次数会变成负一,这里需要返还一次,变为0,客户增加次数时,从0增加
|
|
|
redisUtil.incr(String.format(RedisKey.API_METHOD_COUNT, authorization), 1);
|
|
|
throw new ApiBusinessException(HttpStatus.COUNT_OVER, "");
|