|
@@ -113,12 +113,20 @@ public class PanelServiceImpl implements PanelService {
|
|
|
ErrorMsgConstants.QUERY_USER_ROLE_ERROR);*/
|
|
ErrorMsgConstants.QUERY_USER_ROLE_ERROR);*/
|
|
|
List<Long> roleIds = null;
|
|
List<Long> roleIds = null;
|
|
|
if (ObjectUtil.equal(SecurityUtils.getUserId(), userId)) {
|
|
if (ObjectUtil.equal(SecurityUtils.getUserId(), userId)) {
|
|
|
- String cacheKey= CacheConstants.USER_CACHE_ROLE_OBJECT_KEY+userId.toString();
|
|
|
|
|
|
|
+ String cacheKey= CacheConstants.USER_CACHE_ROLE_ID_KEY+userId.toString();
|
|
|
if(RedisUtils.hasKey(cacheKey))
|
|
if(RedisUtils.hasKey(cacheKey))
|
|
|
{
|
|
{
|
|
|
- List<SysRole> roles = RedisUtils.getCacheObject(cacheKey);
|
|
|
|
|
- //roles 获取id集合
|
|
|
|
|
- roleIds = roles.stream().map(SysRole::getId).collect(Collectors.toList());
|
|
|
|
|
|
|
+ roleIds= RedisUtils.getCacheObject(cacheKey);
|
|
|
|
|
+// List<SysRole> roles = RedisUtils.getCacheObject(cacheKey);
|
|
|
|
|
+// //roles 获取id集合
|
|
|
|
|
+// roleIds = roles.stream().map(SysRole::getId).collect(Collectors.toList());
|
|
|
|
|
+ }
|
|
|
|
|
+ // 缓存有被清空的肯能
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ roleIds = RemoteCallHandlerExecutor.executeRemoteCall(
|
|
|
|
|
+ () -> roleService.getUserRoleId(userId, SecurityConstants.FROM_SOURCE),
|
|
|
|
|
+ ErrorMsgConstants.QUERY_USER_ROLE_ERROR);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
roleIds = RemoteCallHandlerExecutor.executeRemoteCall(
|
|
roleIds = RemoteCallHandlerExecutor.executeRemoteCall(
|