!90 优化数据权限兼容性

Merge pull request !90 from 陈晨成/master
pull/96/MERGE
芋道源码 2024-01-13 13:08:11 +00:00 committed by Gitee
commit 7341b60272
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 5 deletions

View File

@ -26,10 +26,10 @@
<knife4j.version>4.3.0</knife4j.version>
<!-- DB 相关 -->
<druid.version>1.2.19</druid.version>
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
<mybatis-plus-generator.version>3.5.3.2</mybatis-plus-generator.version>
<mybatis-plus.version>3.5.4.1</mybatis-plus.version>
<mybatis-plus-generator.version>3.5.4.1</mybatis-plus-generator.version>
<dynamic-datasource.version>3.6.1</dynamic-datasource.version>
<mybatis-plus-join-boot-starter.version>1.4.6</mybatis-plus-join-boot-starter.version>
<mybatis-plus-join-boot-starter.version>1.4.8</mybatis-plus-join-boot-starter.version>
<redisson.version>3.18.0</redisson.version>
<dm8.jdbc.version>8.1.2.141</dm8.jdbc.version>
<!-- 消息队列 -->

View File

@ -495,8 +495,9 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme
// 生成条件
Expression allExpression = null;
for (DataPermissionRule rule : ContextHolder.getRules()) {
String tableName = MyBatisUtils.getTableName(table);
// 判断表名是否匹配
if (!rule.getTableNames().contains(table.getName())) {
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;