fix:userinfo返回角色编码

This commit is contained in:
2026-02-03 20:34:12 +08:00
parent 28fddc4332
commit 4a2f995584
3 changed files with 48 additions and 39 deletions

View File

@@ -32,4 +32,10 @@ public class SysUserInfoVO implements Serializable {
@Schema(description = "角色标识集合")
private List<Long> roles = new ArrayList<>();
/**
* 角色编码集合
*/
@Schema(description = "角色编码集合")
private List<String> roleCodes = new ArrayList<>();
}

View File

@@ -829,6 +829,9 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserEntity
List<Long> roleIds = sysRoleList.stream().map(SysRoleVO::getRoleId).collect(Collectors.toList());
result.setRoles(roleIds);
List<String> roleCodes = sysRoleList.stream().map(SysRoleVO::getRoleCode).collect(Collectors.toList());
result.setRoleCodes(roleCodes);
// 获取功能编码相关
R<List<String>> functionCodeReturn = honeycomTenantServiceFeign.findFunctionCodesByRoleId(userInfo.getUserId(), String.valueOf(loginDefaultStaff.getTenantId()), SecurityConstants.FROM_IN);
if (Objects.isNull(functionCodeReturn) || !functionCodeReturn.isOk()) {