!2 修复scheduler非web环境下查询错误

Merge pull request !2 from 其实我是kala/N/A
This commit is contained in:
其实我是kala 2023-08-24 16:44:18 +00:00 committed by Gitee
commit ac56beee13
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,5 +1,6 @@
package org.dromara.common.mybatis.handler;
import cn.dev33.satoken.spring.SpringMVCUtil;
import cn.hutool.core.annotation.AnnotationUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ConcurrentHashSet;
@ -72,6 +73,10 @@ public class PlusDataPermissionHandler {
invalidCacheSet.add(mappedStatementId);
return where;
}
// scheduler 为非web环境参考为admin
if (!SpringMVCUtil.isWeb()) {
return where;
}
LoginUser currentUser = DataPermissionHelper.getVariable("user");
if (ObjectUtil.isNull(currentUser)) {
currentUser = LoginHelper.getLoginUser();