fix(sql): 修复未登录MyBatis拦截器报错导致启动失败的bug
This commit is contained in:
1 parent
7bd17b5a18
commit
13cd408a97
1 file changed
+6
@@ -37,6 +37,12 @@ public class MyDataPermissionHandler implements DataPermissionHandler {
|
||||
if(SecurityUtils.isRoot()){
|
||||
return where;
|
||||
}
|
||||
// 如果是未登录,或者是定时任务执行的SQL,直接返回
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if(userId == null){
|
||||
return where;
|
||||
}
|
||||
|
||||
// 获取当前用户的数据权限
|
||||
Integer dataScope = SecurityUtils.getDataScope();
|
||||
DataScopeEnum dataScopeEnum = IBaseEnum.getEnumByValue(dataScope, DataScopeEnum.class);
|
||||
|
||||
Reference in new issue
Block a user