mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
fix 修复 权限为null导致报错问题
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
package org.dromara.common.satoken.core.service;
|
package org.dromara.common.satoken.core.service;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpInterface;
|
import cn.dev33.satoken.stp.StpInterface;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.dromara.common.core.domain.model.LoginUser;
|
import org.dromara.common.core.domain.model.LoginUser;
|
||||||
import org.dromara.common.core.enums.UserType;
|
import org.dromara.common.core.enums.UserType;
|
||||||
@ -39,8 +40,12 @@ public class SaPermissionImpl implements StpInterface {
|
|||||||
if (userType == UserType.APP_USER) {
|
if (userType == UserType.APP_USER) {
|
||||||
// 其他端 自行根据业务编写
|
// 其他端 自行根据业务编写
|
||||||
}
|
}
|
||||||
// SYS_USER 默认返回权限
|
if (CollUtil.isNotEmpty(loginUser.getMenuPermission())) {
|
||||||
return new ArrayList<>(loginUser.getMenuPermission());
|
// SYS_USER 默认返回权限
|
||||||
|
return new ArrayList<>(loginUser.getMenuPermission());
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,8 +67,12 @@ public class SaPermissionImpl implements StpInterface {
|
|||||||
if (userType == UserType.APP_USER) {
|
if (userType == UserType.APP_USER) {
|
||||||
// 其他端 自行根据业务编写
|
// 其他端 自行根据业务编写
|
||||||
}
|
}
|
||||||
// SYS_USER 默认返回权限
|
if (CollUtil.isNotEmpty(loginUser.getRolePermission())) {
|
||||||
return new ArrayList<>(loginUser.getRolePermission());
|
// SYS_USER 默认返回权限
|
||||||
|
return new ArrayList<>(loginUser.getMenuPermission());
|
||||||
|
} else {
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private PermissionService getPermissionService() {
|
private PermissionService getPermissionService() {
|
||||||
|
Reference in New Issue
Block a user