更新控制器菜单接口
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
public async Task<Result> GetMenu()
|
||||
{
|
||||
|
||||
return Result.Success().SetData(await _menuService.GetAllEntitiesTrueAsync());
|
||||
return Result.Success().SetData(await _menuService.GetTopMenu());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -74,8 +74,11 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
await _roleService.SetMenusByRolesId(idsListDto.ids2, idsListDto.ids1);
|
||||
return Result.Success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<Result> GetMenuByRloeIds(List<int> roleIds)
|
||||
{
|
||||
var menuList =await _roleService.GetMenusByRoleId(roleIds);
|
||||
return Result.Success().SetData(menuList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,10 +112,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
/// 根据用户id得到该用户有哪些角色
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public async Task<Result> GetRolesByUserId(int user_id)
|
||||
{
|
||||
var _user =await _userService.GetEntityById(user_id);
|
||||
[HttpPost]
|
||||
public async Task<Result> GetRolesByUserId(user _user)
|
||||
{
|
||||
var roleList = await _userService.GetRolesByUser(_user);
|
||||
return Result.Success().SetData(roleList);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user