用户编辑界面

This commit is contained in:
chenchun
2022-09-11 02:39:33 +08:00
parent 0dca7acee6
commit d001a0de15
12 changed files with 445 additions and 607 deletions

View File

@@ -92,7 +92,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// </summary>
/// <returns></returns>
[HttpGet]
[Authorize]
//[Authorize]
public async Task<Result> GetUserAllInfo()
{
//通过鉴权jwt获取到用户的id
@@ -111,7 +111,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
{
var userId = HttpContext.GetCurrentUserEntityInfo(out _).Id;
var data = await _iUserService.GetUserAllInfo(userId);
//将后端菜单转换成前端路由,组件级别需要过滤
List<VueRouterModel> routers = _iUserService.RouterBuild(data.Menus.ToList());
return Result.Success().SetData(routers);

View File

@@ -34,8 +34,9 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <param name="id"></param>
/// <returns></returns>
[Permission($"{nameof(T)}:get")]
[Route("{id}")]
[HttpGet]
public virtual async Task<Result> GetById(long id)
public virtual async Task<Result> GetById([FromRoute]long id)
{
return Result.Success().SetData(await _repository.GetByIdAsync(id));
}
@@ -45,7 +46,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// </summary>
/// <returns></returns>
[Permission($"{nameof(T)}:get")]
[HttpPost]
[HttpGet]
public virtual async Task<Result> GetList()
{
return Result.Success().SetData(await _repository.GetListAsync());

View File

@@ -21,7 +21,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]
public class RoleController : BaseCrudController<RoleEntity>
public class RoleController : BaseSimpleCrudController<RoleEntity>
{
private IRoleService _iRoleService;
public RoleController(ILogger<RoleEntity> logger, IRoleService iRoleService) : base(logger, iRoleService)

View File

@@ -21,7 +21,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// </summary>
[ApiController]
[Route("api/[controller]/[action]")]
public class UserController : BaseCrudController<UserEntity>
public class UserController : BaseSimpleCrudController<UserEntity>
{
private IUserService _iUserService;
public UserController(ILogger<UserEntity> logger, IUserService iUserService) : base(logger, iUserService)
@@ -85,13 +85,14 @@ namespace Yi.Framework.ApiMicroservice.Controllers
/// <summary>
/// 通过用户id得到角色列表
/// 通过用户id得到用户信息关联部门、岗位、角色
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<Result> GetRoleListByUserId(long userId)
[Route("{id}")]
public override async Task<Result> GetById(long id)
{
return Result.Success().SetData(await _iUserService.GetRoleListByUserId(userId));
return Result.Success().SetData(await _iUserService.GetInfoById(id));
}
}
}