diff --git a/YD_Event.Application/User/Dtos/SysUserPageOutput.cs b/YD_Event.Application/User/Dtos/SysUserPageOutput.cs
index b94034e..bf3e9d1 100644
--- a/YD_Event.Application/User/Dtos/SysUserPageOutput.cs
+++ b/YD_Event.Application/User/Dtos/SysUserPageOutput.cs
@@ -15,6 +15,11 @@ public class SysUserPageOutput : KeyDto
///
public string Account { get; set; }
+ ///
+ /// 关联角色Id列表(逗号分隔)
+ ///
+ public string RoleIds { get; set; }
+
///
/// 关联角色名称(逗号分隔)
///
diff --git a/YD_Event.Application/User/SysUserService.cs b/YD_Event.Application/User/SysUserService.cs
index 1e9538e..7e36154 100644
--- a/YD_Event.Application/User/SysUserService.cs
+++ b/YD_Event.Application/User/SysUserService.cs
@@ -71,7 +71,7 @@ public class SysUserService : BaseService, ITransient
var userRoles = await _userRoleRepository.AsQueryable()
.InnerJoin((ur, r) => ur.RoleId == r.Id)
.Where((ur, r) => userIds.Contains(ur.UserId))
- .Select((ur, r) => new { ur.UserId, RoleName = r.Name })
+ .Select((ur, r) => new { ur.UserId,r.Id, RoleName = r.Name })
.ToListAsync();
foreach (var user in entityList.Rows)
@@ -79,6 +79,8 @@ public class SysUserService : BaseService, ITransient
var output = user.Adapt();
var roles = userRoles.Where(x => x.UserId == user.Id).Select(x => x.RoleName).ToList();
output.RoleNames = string.Join(",", roles);
+ var roleIds = userRoles.Where(x => x.UserId == user.Id).Select(x => x.Id).ToList();
+ output.RoleIds = string.Join(",", roleIds);
resultList.Add(output);
}