From d58da7b2b0752dd541db998957ae79beec2a65b2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 13 Jan 2024 21:08:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20https://gitee.com/zhijiant?= =?UTF-8?q?ianya/yudao-cloud/pulls/90/files=20pr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/db/DataPermissionDatabaseInterceptor.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java index 98f64d11ac..cbeedee4d2 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/db/DataPermissionDatabaseInterceptor.java @@ -496,7 +496,8 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme Expression allExpression = null; for (DataPermissionRule rule : ContextHolder.getRules()) { // 判断表名是否匹配 - if (!rule.getTableNames().contains(table.getName())) { + String tableName = MyBatisUtils.getTableName(table); + if (!rule.getTableNames().contains(tableName)) { continue; } // 如果有匹配的规则,说明可重写。 @@ -505,7 +506,6 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme ContextHolder.setRewrite(true); // 单条规则的条件 - String tableName = MyBatisUtils.getTableName(table); Expression oneExpress = rule.getExpression(tableName, table.getAlias()); if (oneExpress == null){ continue;