Browse Source

使用 @Lazy,@AutoConfigureBefore注解解决循环引用及Bean重复问题,删除allow-bean-definition-overriding: true, allow-circular-references: true配置信息

master
淡然逝去 2 years ago committed by Gitee
parent
commit
1297d094cb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 1
      ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java
  2. 1
      ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java
  3. 3
      ruoyi-gateway/src/main/resources/bootstrap.yml

1
ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/configure/RedisConfig.java

@ -15,6 +15,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer; @@ -15,6 +15,7 @@ import org.springframework.data.redis.serializer.StringRedisSerializer;
*/
@Configuration
@EnableCaching
@AutoConfigureBefore(RedisAutoConfiguration.class)
public class RedisConfig extends CachingConfigurerSupport
{
@Bean

1
ruoyi-gateway/src/main/java/com/ruoyi/gateway/config/SwaggerProvider.java

@ -27,6 +27,7 @@ public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigu @@ -27,6 +27,7 @@ public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigu
/**
* 网关路由
*/
@Lazy
@Autowired
private RouteLocator routeLocator;

3
ruoyi-gateway/src/main/resources/bootstrap.yml

@ -10,9 +10,6 @@ spring: @@ -10,9 +10,6 @@ spring:
profiles:
# 环境配置
active: dev
main:
allow-circular-references: true
allow-bean-definition-overriding: true
cloud:
nacos:
discovery:

Loading…
Cancel
Save