Exemplo n.º 1
0
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="input"></param>
        /// <param name="output"></param>
        /// <param name="errMsg"></param>
        /// <returns></returns>
        public bool ChangePassword(ChangePasswordInput input, ref ChangePasswordOutput output, ref string errMsg)
        {
            bool doChange = HttpCommonMethod <ChangePasswordInput, ChangePasswordOutput>("/antuser/user.resetPassword.do", GlobalVariable.RequestMethod.POST, input, ref output, ref errMsg);

            if (doChange && output.result == (int)GlobalVariable.Result.Failure)
            {
                errMsg = string.IsNullOrEmpty(output.errorCode) ? "修改密码失败" : resources.GetString("E_" + output.errorCode);
                return(false);
            }
            return(doChange);
        }
Exemplo n.º 2
0
        public ChangePasswordOutput ChangePassword(ChangePasswordInput input)
        {
            try
            {
                RestHTTP    http = new RestHTTP();
                RestRequest req  = new RestRequest("api/accounts/ChangePassword", RestSharp.Method.POST);
                req.AddHeader("Content-Type", "application/json");
                req.AddHeader("Authorization", "Bearer " + input.AccessToken);
                req.AddJsonBody(input);
                ChangePasswordOutput response = http.HttpPost <ChangePasswordOutput>(req);

                return(response);
            }
            catch (Exception ex)
            {
                WriteLogFile.Append("ConfirmPassword : ");
                WriteLogFile.Append(ex.Message);
                WriteLogFile.Append(ex.StackTrace);
            }
            return(null);
        }
 public void Standart(ChangePasswordOutput output) => ViewModel = new OkObjectResult(output.Success);
Exemplo n.º 4
0
 public IHttpActionResult ChangePassword(ChangePasswordInput input)
 {
     Init();
     ChangePasswordOutput output = _authSvc.ChangePassword(input);
     return Ok(output);
 }