fix(sql): 修复未登录MyBatis拦截器报错导致启动失败的bug
This commit is contained in:
@@ -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