|
@@ -31,6 +31,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
|
|
+import java.io.Serializable;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
@@ -175,13 +176,13 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
List<String> tokens =stpLogic.getTokenValueListByLoginId(sysUserRole.getUserId());
|
|
List<String> tokens =stpLogic.getTokenValueListByLoginId(sysUserRole.getUserId());
|
|
|
tokens.
|
|
tokens.
|
|
|
parallelStream().forEach(token->{
|
|
parallelStream().forEach(token->{
|
|
|
- SaSession tokenSessionByToken = stpLogic.getTokenSessionByToken(token);
|
|
|
|
|
- LoginUser user = (LoginUser) tokenSessionByToken.get(Constants.LOGIN_USER_KEY);
|
|
|
|
|
- if(user!=null){
|
|
|
|
|
- user.setPermissions(permissionsByUserId);
|
|
|
|
|
- tokenSessionByToken.set(Constants.LOGIN_USER_KEY,user);
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ SaSession tokenSessionByToken = stpLogic.getTokenSessionByToken(token);
|
|
|
|
|
+ LoginUser user = (LoginUser) tokenSessionByToken.get(Constants.LOGIN_USER_KEY);
|
|
|
|
|
+ if(user!=null){
|
|
|
|
|
+ user.setPermissions(permissionsByUserId);
|
|
|
|
|
+ tokenSessionByToken.set(Constants.LOGIN_USER_KEY,user);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -217,7 +218,13 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public List<SysRole> listSysRoleByUserId(Long userId) {
|
|
public List<SysRole> listSysRoleByUserId(Long userId) {
|
|
|
- List<SysUserRole> sysUserRoleList = sysUserRoleService.list(Wrappers.lambdaQuery(SysUserRole.class).eq(SysUserRole::getUserId, userId));
|
|
|
|
|
|
|
+ return listSysRoleByUserId(userId,null);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<SysRole> listSysRoleByUserId(Long userId, String tenantId) {
|
|
|
|
|
+ List<SysUserRole> sysUserRoleList = sysUserRoleService.list(Wrappers.lambdaQuery(SysUserRole.class).eq(SysUserRole::getUserId, userId)
|
|
|
|
|
+ .eq(StrUtil.isNotEmpty(tenantId),SysUserRole::getTenantId,tenantId));
|
|
|
if (sysUserRoleList.isEmpty()) {
|
|
if (sysUserRoleList.isEmpty()) {
|
|
|
return Lists.newArrayList();
|
|
return Lists.newArrayList();
|
|
|
}
|
|
}
|