|
@@ -34,13 +34,10 @@ public class StpInterfaceImpl implements StpInterface {
|
|
|
public List<String> getPermissionList(Object loginIdObj, String loginType) {
|
|
|
|
|
|
List<String> list = new ArrayList<String>();
|
|
|
- // 后期接口调用次数大的话,可以放redis ,再加更新操作
|
|
|
- long loginId = Long.parseLong(String.valueOf(loginIdObj));
|
|
|
-
|
|
|
- List<String> roleList = this.getRoleList(loginId, loginType);
|
|
|
+ List<String> roleList = this.getRoleList(loginIdObj, loginType);
|
|
|
for (String roleCode : roleList) {
|
|
|
String rolePermKeyPre = "hfln:perm:";
|
|
|
- Set<String> permList = (Set<String>) redisService.get(rolePermKeyPre + roleCode);
|
|
|
+ Set<String> permList = (Set<String>)(Set<?>) redisService.sMembers(rolePermKeyPre + roleCode);
|
|
|
if (CollectionUtils.isEmpty(permList)) {
|
|
|
log.info("当前角色未配置权限, roleCode :{}", roleCode);
|
|
|
continue;
|
|
@@ -56,12 +53,11 @@ public class StpInterfaceImpl implements StpInterface {
|
|
|
@Override
|
|
|
public List<String> getRoleList(Object loginIdObj, String loginType) {
|
|
|
|
|
|
- long loginId = Long.parseLong(String.valueOf(loginIdObj));
|
|
|
// 当前登录用户的角色
|
|
|
String roleKeyPre = "hfln:role:";
|
|
|
- Set<String> roleList = (Set<String>) redisService.get(roleKeyPre + loginId);
|
|
|
+ Set<String> roleList = (Set<String>)(Set<?>)redisService.sMembers(roleKeyPre + loginIdObj);
|
|
|
if (CollectionUtils.isEmpty(roleList)) {
|
|
|
- log.info("当前账户未配置角色, loginId :{}", loginId);
|
|
|
+ log.info("当前账户未配置角色, loginId :{}", loginIdObj);
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
return new ArrayList<>(roleList);
|