mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-02-14 04:53:53 +00:00
当需要租户隔离时才添加多租户插件
This commit is contained in:
parent
04a26cdd6d
commit
0859784c3b
@ -93,6 +93,8 @@ public class MybatisPlusSaasConfig {
|
|||||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
// 先 add TenantLineInnerInterceptor 再 add PaginationInnerInterceptor
|
// 先 add TenantLineInnerInterceptor 再 add PaginationInnerInterceptor
|
||||||
|
// 条件注册租户拦截器:当需要租户隔离时才添加
|
||||||
|
if (OPEN_SYSTEM_TENANT_CONTROL) {
|
||||||
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() {
|
interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(new TenantLineHandler() {
|
||||||
@Override
|
@Override
|
||||||
public Expression getTenantId() {
|
public Expression getTenantId() {
|
||||||
@ -127,6 +129,7 @@ public class MybatisPlusSaasConfig {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
}
|
||||||
//update-begin-author:zyf date:20220425 for:【VUEN-606】注入动态表名适配拦截器解决多表名问题
|
//update-begin-author:zyf date:20220425 for:【VUEN-606】注入动态表名适配拦截器解决多表名问题
|
||||||
interceptor.addInnerInterceptor(dynamicTableNameInnerInterceptor());
|
interceptor.addInnerInterceptor(dynamicTableNameInnerInterceptor());
|
||||||
//update-end-author:zyf date:20220425 for:【VUEN-606】注入动态表名适配拦截器解决多表名问题
|
//update-end-author:zyf date:20220425 for:【VUEN-606】注入动态表名适配拦截器解决多表名问题
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user