用户信息添加修改
This commit is contained in:
@@ -130,7 +130,7 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
var userEntiy = await _iUserService._repository.GetByIdAsync(userId);
|
||||
|
||||
//判断输入的老密码是否和原密码相同
|
||||
if (_iUserService.JudgePassword(userEntiy, updatePasswordDto.OldPassword))
|
||||
if (userEntiy.JudgePassword(updatePasswordDto.OldPassword))
|
||||
{
|
||||
userEntiy.Password = updatePasswordDto.NewPassword;
|
||||
userEntiy.BuildPassword();
|
||||
|
||||
@@ -94,5 +94,26 @@ namespace Yi.Framework.ApiMicroservice.Controllers
|
||||
{
|
||||
return Result.Success().SetData(await _iUserService.GetInfoById(id));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新用户信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPut]
|
||||
public async Task<Result> UpdateInfo(UserInfoDto userDto)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iUserService.UpdateInfo(userDto));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加用户
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<Result> AddInfo(UserInfoDto userDto)
|
||||
{
|
||||
return Result.Success().SetStatus(await _iUserService.AddInfo(userDto));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user