|
@@ -136,7 +136,10 @@ public class RoleController : BaseController
|
|
|
[HttpPut]
|
|
|
public async Task Update([FromBody] UpdateRoleDto dto)
|
|
|
{
|
|
|
- await _roleRepository.UpdateAsync(_mapper.Map<Role>(dto), HttpContext.RequestAborted);
|
|
|
+ var role = await _roleRepository.GetAsync(dto.Id, HttpContext.RequestAborted);
|
|
|
+ if (role == null) throw new UserFriendlyException("无效角色编号");
|
|
|
+ _mapper.Map(dto, role);
|
|
|
+ await _roleRepository.UpdateAsync(role, HttpContext.RequestAborted);
|
|
|
}
|
|
|
|
|
|
#region 应用权限管理
|