Skip to content

Commit d1db737

Browse files
KAICharles7c
authored andcommitted
fix(extension/tenant): 修复多租户下开启多数据源拦截器返回结果异常的情况
1 parent b7eda50 commit d1db737

File tree

1 file changed

+3
-2
lines changed
  • continew-starter-extension/continew-starter-extension-tenant/continew-starter-extension-tenant-mp/src/main/java/top/continew/starter/extension/tenant/handler/datasource

1 file changed

+3
-2
lines changed

continew-starter-extension/continew-starter-extension-tenant/continew-starter-extension-tenant-mp/src/main/java/top/continew/starter/extension/tenant/handler/datasource/TenantDataSourceInterceptor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package top.continew.starter.extension.tenant.handler.datasource;
1818

1919
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
20+
import jakarta.annotation.Nonnull;
2021
import org.aopalliance.intercept.MethodInterceptor;
2122
import org.aopalliance.intercept.MethodInvocation;
2223
import top.continew.starter.extension.tenant.context.TenantContextHolder;
@@ -38,10 +39,10 @@ public TenantDataSourceInterceptor(TenantDataSourceHandler tenantDataSourceHandl
3839
}
3940

4041
@Override
41-
public Object invoke(MethodInvocation invocation) throws Throwable {
42+
public Object invoke(@Nonnull MethodInvocation invocation) throws Throwable {
4243
// 忽略租户
4344
if (TenantContextHolder.isIgnore()) {
44-
return true;
45+
return invocation.proceed();
4546
}
4647
// 忽略行级隔离
4748
if (TenantIsolationLevel.LINE.equals(TenantContextHolder.getIsolationLevel())) {

0 commit comments

Comments
 (0)