Commit 8500575f443c9ca3b6e964d50a368bc3fa1fa46a
1 parent
1c0909d9
fix:TenantDatabaseInterceptor 针对 TenantBaseDO 忽略不正确
Showing
1 changed file
with
2 additions
and
2 deletions
yudao-framework/yudao-spring-boot-starter-biz-tenant/src/main/java/cn/iocoder/yudao/framework/tenant/core/db/TenantDatabaseInterceptor.java
| @@ -66,14 +66,14 @@ public class TenantDatabaseInterceptor implements TenantLineHandler { | @@ -66,14 +66,14 @@ public class TenantDatabaseInterceptor implements TenantLineHandler { | ||
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | private boolean computeIgnoreTable(String tableName) { | 68 | private boolean computeIgnoreTable(String tableName) { |
| 69 | - // 找不到的表,说明不是 yudao 项目里的,不进行拦截 | 69 | + // 找不到的表,说明不是 yudao 项目里的,不进行拦截(忽略租户) |
| 70 | TableInfo tableInfo = TableInfoHelper.getTableInfo(tableName); | 70 | TableInfo tableInfo = TableInfoHelper.getTableInfo(tableName); |
| 71 | if (tableInfo == null) { | 71 | if (tableInfo == null) { |
| 72 | return true; | 72 | return true; |
| 73 | } | 73 | } |
| 74 | // 如果继承了 TenantBaseDO 基类,显然不忽略租户 | 74 | // 如果继承了 TenantBaseDO 基类,显然不忽略租户 |
| 75 | if (TenantBaseDO.class.isAssignableFrom(tableInfo.getEntityType())) { | 75 | if (TenantBaseDO.class.isAssignableFrom(tableInfo.getEntityType())) { |
| 76 | - return true; | 76 | + return false; |
| 77 | } | 77 | } |
| 78 | // 如果添加了 @TenantIgnore 注解,显然也不忽略租户 | 78 | // 如果添加了 @TenantIgnore 注解,显然也不忽略租户 |
| 79 | TenantIgnore tenantIgnore = tableInfo.getEntityType().getAnnotation(TenantIgnore.class); | 79 | TenantIgnore tenantIgnore = tableInfo.getEntityType().getAnnotation(TenantIgnore.class); |