/// <summary> /// 保存密码 /// </summary> /// <returns></returns> public ActionResult SavePassword(string newPassword) { return(ExceptionCatch.Invoke(() => { var curUser = UserHelper.GetCurrentUser(); UserService.ChangePassword(curUser.Id, newPassword); })); }
public async Task <VsfResponse> ChangePassword(string userId, ChangePasswordModel changePasswordModel) { using (await UserLocker.LockAsync(userId)) { if (!await _userAdapter.ChangePassword(userId, changePasswordModel.CurrentPassword, changePasswordModel.NewPassword)) { return(new VsfErrorResponse("The password doesn't match this account.")); } return(new VsfSuccessResponse <string>("Password changed.")); } }