From 9b6b288e735ee19761cdb05c863579714f5b86b8 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期二, 29 十月 2024 16:42:04 +0800 Subject: [PATCH] update 优化 多租户插件初始化流程 --- ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java index 0ff39fd..010e1e4 100644 --- a/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java +++ b/ruoyi-common/ruoyi-common-tenant/src/main/java/org/dromara/common/tenant/config/TenantConfig.java @@ -4,7 +4,6 @@ import cn.hutool.core.util.ObjectUtil; import com.baomidou.mybatisplus.extension.plugins.inner.TenantLineInnerInterceptor; import org.dromara.common.core.utils.reflect.ReflectUtils; -import org.dromara.common.mybatis.config.MybatisPlusConfig; import org.dromara.common.redis.config.RedisConfig; import org.dromara.common.redis.config.properties.RedissonProperties; import org.dromara.common.tenant.core.TenantSaTokenDao; @@ -16,6 +15,7 @@ import org.redisson.config.SingleServerConfig; import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer; import org.springframework.boot.autoconfigure.AutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.cache.CacheManager; @@ -28,13 +28,14 @@ * @author Lion Li */ @EnableConfigurationProperties(TenantProperties.class) -@AutoConfiguration(after = {RedisConfig.class, MybatisPlusConfig.class}) +@AutoConfiguration(after = {RedisConfig.class}) @ConditionalOnProperty(value = "tenant.enable", havingValue = "true") public class TenantConfig { /** * 澶氱鎴锋彃浠� */ + @ConditionalOnClass(TenantLineInnerInterceptor.class) @Bean public TenantLineInnerInterceptor tenantLineInnerInterceptor(TenantProperties tenantProperties) { return new TenantLineInnerInterceptor(new PlusTenantLineHandler(tenantProperties)); -- Gitblit v1.9.3