fix(ruoyi-common-mybatis): 修复租户未登录用户查询数据异常
- 在 getSqlSegment 方法中增加对用户登录状态的判断 - 如果用户未登录,则直接返回原始 SQL 条件,不进行数据权限过滤 - 优化了数据权限处理逻辑,提高了系统稳定性
This commit is contained in:
parent
4e6077cb7c
commit
fb31eea82b
@ -1,5 +1,6 @@
|
||||
package org.dromara.common.mybatis.handler;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.hutool.core.annotation.AnnotationUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
@ -86,6 +87,9 @@ public class PlusDataPermissionHandler {
|
||||
* @return 数据过滤条件的 SQL 片段
|
||||
*/
|
||||
public Expression getSqlSegment(Expression where, String mappedStatementId, boolean isSelect) {
|
||||
if (!StpUtil.isLogin()) {
|
||||
return where;
|
||||
}
|
||||
// 获取数据权限配置
|
||||
DataPermission dataPermission = getDataPermission(mappedStatementId);
|
||||
// 获取当前登录用户信息
|
||||
|
Loading…
x
Reference in New Issue
Block a user