fix 用户和菜单权限联合
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user