コード例 #1
0
 /// <summary>
 /// 保存密码
 /// </summary>
 /// <returns></returns>
 public ActionResult SavePassword(string newPassword)
 {
     return(ExceptionCatch.Invoke(() =>
     {
         var curUser = UserHelper.GetCurrentUser();
         UserService.ChangePassword(curUser.Id, newPassword);
     }));
 }
コード例 #2
0
        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."));
            }
        }