update 优化多租户插件初始化流程
启用多租户才需要初始化,不启用则不初始化
This commit is contained in:
parent
5be1d3e19e
commit
271c4c2bfc
@ -37,8 +37,11 @@ public class MybatisPlusConfig {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
// 多租户插件 必须放到第一位
|
||||
try {
|
||||
TenantLineInnerInterceptor tenant = SpringUtils.getBean(TenantLineInnerInterceptor.class);
|
||||
interceptor.addInnerInterceptor(tenant);
|
||||
boolean enableTenant = Boolean.parseBoolean(SpringUtils.getProperty("tenant.enable"));
|
||||
if (enableTenant) {
|
||||
TenantLineInnerInterceptor tenant = SpringUtils.getBean(TenantLineInnerInterceptor.class);
|
||||
interceptor.addInnerInterceptor(tenant);
|
||||
}
|
||||
} catch (BeansException ignore) {
|
||||
}
|
||||
// 数据权限处理
|
||||
|
Loading…
x
Reference in New Issue
Block a user