|
@@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit;
|
|
|
@Configuration
|
|
|
public class RedisLimitAspect {
|
|
|
|
|
|
- private final static String REDIS_LIMIT_KEY_PREFIX = "track:limit:";
|
|
|
+ private final static String REDIS_LIMIT_KEY_PREFIX = "openapi:limit:";
|
|
|
|
|
|
@Autowired
|
|
|
private RedisTemplate redisTemplate;
|
|
@@ -77,9 +77,6 @@ public class RedisLimitAspect {
|
|
|
}
|
|
|
|
|
|
private boolean shouldLimited(String key, long max, long timeout, TimeUnit timeUnit) {
|
|
|
- // 最终的 key 格式为:
|
|
|
- // limit:自定义key:IP
|
|
|
- // limit:类名.方法名:IP
|
|
|
key = REDIS_LIMIT_KEY_PREFIX + key;
|
|
|
// 统一使用单位毫秒
|
|
|
long ttl = timeUnit.toMillis(timeout);
|