|
|
@ -67,15 +67,14 @@ spring.redis.host=127.0.0.1 |
|
|
|
spring.redis.port=6379 |
|
|
|
spring.redis.port=6379 |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
- ZuulConfig.java中添加如下代码: |
|
|
|
- 在启动类中添加如下代码: |
|
|
|
|
|
|
|
|
|
|
|
```java |
|
|
|
```java |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private RedisTemplate redisTemplate; |
|
|
|
private RedisTemplate redisTemplate; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@PostConstruct |
|
|
|
protected void doAfter() { |
|
|
|
public void doAfter() { |
|
|
|
super.doAfter(); |
|
|
|
|
|
|
|
ApiConfig.getInstance().setLimitManager(new RedisLimitManager(redisTemplate)); |
|
|
|
ApiConfig.getInstance().setLimitManager(new RedisLimitManager(redisTemplate)); |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|