|
@ -100,6 +100,14 @@ public class SysPermissionService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getPortalToken(String userId) { |
|
|
|
|
|
Object cache = redisCache.getCacheObject(tokenKey(userId)); |
|
|
|
|
|
if (cache != null) { |
|
|
|
|
|
return StringUtils.cast(cache); |
|
|
|
|
|
} else { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public void setUserPermissionFromPortal(String userId, List<String> perms) { |
|
|
public void setUserPermissionFromPortal(String userId, List<String> perms) { |
|
|
if (CollectionUtils.isEmpty(perms)) { |
|
|
if (CollectionUtils.isEmpty(perms)) { |
|
@ -115,6 +123,10 @@ public class SysPermissionService { |
|
|
redisCache.setCacheObject(menusKey(userId), menus, 7, TimeUnit.DAYS); |
|
|
redisCache.setCacheObject(menusKey(userId), menus, 7, TimeUnit.DAYS); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setPortalToken(String userId, String token) { |
|
|
|
|
|
redisCache.setCacheObject(tokenKey(userId), token, 7, TimeUnit.DAYS); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Data |
|
|
@Data |
|
|
@AllArgsConstructor |
|
|
@AllArgsConstructor |
|
|
@NoArgsConstructor |
|
|
@NoArgsConstructor |
|
@ -127,6 +139,10 @@ public class SysPermissionService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String tokenKey(String userId) { |
|
|
|
|
|
return "portal_token:" + userId; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private String permsKey(String userId) { |
|
|
private String permsKey(String userId) { |
|
|
return "user_perms:" + userId; |
|
|
return "user_perms:" + userId; |
|
|
} |
|
|
} |
|
|