|
|
@@ -27,7 +27,10 @@ public class SaPermissionImpl implements StpInterface {
|
|
|
@Override
|
|
|
public List<String> getPermissionList(Object loginId, String loginType) {
|
|
|
LoginUser loginUser = LoginHelper.getLoginUser();
|
|
|
- if (ObjectUtil.isNull(loginUser) || !loginUser.getLoginId().equals(loginId)) {
|
|
|
+ if (ObjectUtil.isNull(loginUser)) {
|
|
|
+ return new ArrayList<>();
|
|
|
+ }
|
|
|
+ if (!loginUser.getLoginId().equals(loginId)) {
|
|
|
PermissionService permissionService = getPermissionService();
|
|
|
if (ObjectUtil.isNotNull(permissionService)) {
|
|
|
List<String> list = StringUtils.splitList(loginId.toString(), ":");
|
|
|
@@ -36,7 +39,15 @@ public class SaPermissionImpl implements StpInterface {
|
|
|
throw new ServiceException("PermissionService 实现类不存在");
|
|
|
}
|
|
|
}
|
|
|
+ // 判断是否为超级管理员
|
|
|
+ if (LoginHelper.isSuperAdmin(loginUser.getUserId())) {
|
|
|
+ // 返回通配符权限,代表拥有所有权限
|
|
|
+ return List.of("*");
|
|
|
+ }
|
|
|
UserType userType = UserType.getUserType(loginUser.getUserType());
|
|
|
+ if (userType == UserType.APP_USER) {
|
|
|
+ // 其用户类型 自行根据业务编写
|
|
|
+ }
|
|
|
if (CollUtil.isNotEmpty(loginUser.getMenuPermission())) {
|
|
|
// SYS_USER 默认返回权限
|
|
|
return new ArrayList<>(loginUser.getMenuPermission());
|
|
|
@@ -62,7 +73,7 @@ public class SaPermissionImpl implements StpInterface {
|
|
|
}
|
|
|
UserType userType = UserType.getUserType(loginUser.getUserType());
|
|
|
if (userType == UserType.APP_USER) {
|
|
|
- // 其他端 自行根据业务编写
|
|
|
+ // 其用户类型 自行根据业务编写
|
|
|
}
|
|
|
// SYS_USER 默认返回权限
|
|
|
if (CollUtil.isNotEmpty(loginUser.getRolePermission())) {
|