|
@@ -11,6 +11,7 @@ using XF.Domain.Exceptions;
|
|
|
using XF.Utility.AppIdentityModel;
|
|
|
using Hotline.Share.Dtos;
|
|
|
using Hotline.Share.Dtos.Role;
|
|
|
+using Hotline.Identity.Roles;
|
|
|
|
|
|
namespace Hotline.Api.Controllers;
|
|
|
|
|
@@ -218,14 +219,14 @@ public class UserController : BaseController
|
|
|
/// <returns></returns>
|
|
|
[Permission(EPermission.GetUserRoles)]
|
|
|
[HttpGet("{id}/roles")]
|
|
|
- public async Task<IReadOnlyList<RoleDto>> GetUserRoles(string id)
|
|
|
+ public async Task<IReadOnlyList<Role>> GetUserRoles(string id)
|
|
|
{
|
|
|
var account = await _accountRepository.Queryable()
|
|
|
.Includes(d => d.Roles)
|
|
|
.FirstAsync(d => d.Id == id);
|
|
|
if (account == null)
|
|
|
throw UserFriendlyException.SameMessage("无效账号编号");
|
|
|
- return _mapper.Map<IReadOnlyList<RoleDto>>(account.Roles);
|
|
|
+ return account.Roles;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|