|
@@ -38,12 +38,12 @@ public class StpInterfaceImpl implements StpInterface {
|
|
long loginId = Long.parseLong(String.valueOf(loginIdObj));
|
|
long loginId = Long.parseLong(String.valueOf(loginIdObj));
|
|
|
|
|
|
List<String> roleList = this.getRoleList(loginId, loginType);
|
|
List<String> roleList = this.getRoleList(loginId, loginType);
|
|
- for (String roleId : roleList) {
|
|
|
|
|
|
+ for (String roleCode : roleList) {
|
|
String rolePermKeyPre = "hfln:perm:";
|
|
String rolePermKeyPre = "hfln:perm:";
|
|
- Set<String> permList = (Set<String>) redisService.get(rolePermKeyPre + roleId);
|
|
|
|
- if (permList == null) {
|
|
|
|
- log.error("角色权限列表不存在, roleId :{}", roleId);
|
|
|
|
- throw new RuntimeException(roleId + "角色权限列表不存在");
|
|
|
|
|
|
+ Set<String> permList = (Set<String>) redisService.get(rolePermKeyPre + roleCode);
|
|
|
|
+ if (CollectionUtils.isEmpty(permList)) {
|
|
|
|
+ log.info("当前角色未配置权限, roleCode :{}", roleCode);
|
|
|
|
+ continue;
|
|
}
|
|
}
|
|
list.addAll(permList);
|
|
list.addAll(permList);
|
|
}
|
|
}
|
|
@@ -61,8 +61,8 @@ public class StpInterfaceImpl implements StpInterface {
|
|
String roleKeyPre = "hfln:role:";
|
|
String roleKeyPre = "hfln:role:";
|
|
Set<String> roleList = (Set<String>) redisService.get(roleKeyPre + loginId);
|
|
Set<String> roleList = (Set<String>) redisService.get(roleKeyPre + loginId);
|
|
if (CollectionUtils.isEmpty(roleList)) {
|
|
if (CollectionUtils.isEmpty(roleList)) {
|
|
- log.error("角色配置异常, loginId :{}", loginId);
|
|
|
|
- throw new RuntimeException("角色配置异常");
|
|
|
|
|
|
+ log.info("当前账户未配置角色, loginId :{}", loginId);
|
|
|
|
+ return new ArrayList<>();
|
|
}
|
|
}
|
|
return new ArrayList<>(roleList);
|
|
return new ArrayList<>(roleList);
|
|
}
|
|
}
|