Commit d58da7b2b0752dd541db998957ae79beec2a65b2
1 parent
8b3bfcbd
同步 https://gitee.com/zhijiantianya/yudao-cloud/pulls/90/files pr
Showing
1 changed file
with
2 additions
and
2 deletions
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 |
| 496 | 496 | Expression allExpression = null; |
| 497 | 497 | for (DataPermissionRule rule : ContextHolder.getRules()) { |
| 498 | 498 | // 判断表名是否匹配 |
| 499 | - if (!rule.getTableNames().contains(table.getName())) { | |
| 499 | + String tableName = MyBatisUtils.getTableName(table); | |
| 500 | + if (!rule.getTableNames().contains(tableName)) { | |
| 500 | 501 | continue; |
| 501 | 502 | } |
| 502 | 503 | // 如果有匹配的规则,说明可重写。 |
| ... | ... | @@ -505,7 +506,6 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme |
| 505 | 506 | ContextHolder.setRewrite(true); |
| 506 | 507 | |
| 507 | 508 | // 单条规则的条件 |
| 508 | - String tableName = MyBatisUtils.getTableName(table); | |
| 509 | 509 | Expression oneExpress = rule.getExpression(tableName, table.getAlias()); |
| 510 | 510 | if (oneExpress == null){ |
| 511 | 511 | continue; | ... | ... |