mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-10-15 20:58:37 +08:00
fix(extension/tenant): 修复多租户下开启多数据源拦截器返回结果异常的情况
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package top.continew.starter.extension.tenant.handler.datasource;
|
||||
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import jakarta.annotation.Nonnull;
|
||||
import org.aopalliance.intercept.MethodInterceptor;
|
||||
import org.aopalliance.intercept.MethodInvocation;
|
||||
import top.continew.starter.extension.tenant.context.TenantContextHolder;
|
||||
@@ -38,10 +39,10 @@ public class TenantDataSourceInterceptor implements MethodInterceptor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation invocation) throws Throwable {
|
||||
public Object invoke(@Nonnull MethodInvocation invocation) throws Throwable {
|
||||
// 忽略租户
|
||||
if (TenantContextHolder.isIgnore()) {
|
||||
return true;
|
||||
return invocation.proceed();
|
||||
}
|
||||
// 忽略行级隔离
|
||||
if (TenantIsolationLevel.LINE.equals(TenantContextHolder.getIsolationLevel())) {
|
||||
|
Reference in New Issue
Block a user