fix 用户和菜单权限联合

This commit is contained in:
2024-01-08 10:35:25 +08:00
parent 82e77027e3
commit f4e401d649
22 changed files with 257 additions and 93 deletions

View File

@@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc;
namespace Dlhis.User.Identity.Controllers;
/// <summary>
/// 用户
/// </summary>
[Authorize(Roles = "admin")]
[Route("api/[controller]")]
[ApiController]
@@ -29,4 +32,21 @@ public class UsersController : ControllerBase
{
return await _userService.GetPageAsync(request);
}
/// <summary>
/// 获取用户列表
/// </summary>
/// <returns></returns>
[HttpGet("list")]
public async Task<List<UserResponse>> GetUsersAsync()
{
return await _userService.GetUsersAsync();
}
[Authorize]
[HttpGet]
public async Task<UserResponse> GetUserByIdAsync(int id)
{
return await _userService.GetUserByIdAsync(id);
}
}