소스 검색

update 优化 多租户插件初始化流程

疯狂的狮子Li 8 달 전
부모
커밋
112157ade0
1개의 변경된 파일11개의 추가작업 그리고 6개의 파일을 삭제
  1. 11 6
      ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java

+ 11 - 6
ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java

@@ -32,13 +32,18 @@ import org.springframework.context.annotation.Primary;
 @ConditionalOnProperty(value = "tenant.enable", havingValue = "true")
 public class TenantConfig {
 
-    /**
-     * 多租户插件
-     */
     @ConditionalOnClass(TenantLineInnerInterceptor.class)
-    @Bean
-    public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) {
-        return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties));
+    @AutoConfiguration
+    static class MybatisPlusConfiguration {
+
+        /**
+         * 多租户插件
+         */
+        @Bean
+        public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) {
+            return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties));
+        }
+
     }
 
     @Bean