| | |
| | | pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uGestureNotEqual));
|
| | | return;
|
| | | }
|
| | | UserCenterResourse.Option.GestureAuthentication = i_Psw;
|
| | | UserCenterResourse.Option.Save();
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | //保存密码
|
| | | this.SaveSecondaryPassword(pswControl, i_Psw);
|
| | | }
|
| | | else if (formMode == FormMode.A验证前回密码)
|
| | | {
|
| | |
| | | }
|
| | | else if (formMode == FormMode.A修改密码)
|
| | | {
|
| | | if (i_Psw == UserCenterResourse.Option.GestureAuthentication)
|
| | | {
|
| | | //新密码和原密码一致,请重新输入
|
| | | pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uNewPswAndOldPswIsEqual));
|
| | | return;
|
| | | }
|
| | | if (pswLength <= 4)
|
| | | {
|
| | | //手势密码长度必须大于4
|
| | |
| | | pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uGestureNotEqual));
|
| | | return;
|
| | | }
|
| | | UserCenterResourse.Option.GestureAuthentication = i_Psw;
|
| | | UserCenterResourse.Option.Save();
|
| | | //关闭界面
|
| | | this.CloseForm();
|
| | | //保存密码
|
| | | this.SaveSecondaryPassword(pswControl, i_Psw);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 保存密码___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 保存密码
|
| | | /// </summary>
|
| | | /// <param name="contr">控件</param>
|
| | | /// <param name="psw">密码</param>
|
| | | private void SaveSecondaryPassword(PswGestureInputControl contr, string psw)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var pra = new
|
| | | {
|
| | | RequestVersion = Common.CommonPage.RequestVersion,
|
| | | LoginAccessToken = Common.Config.Instance.Token,
|
| | | GesturePwd = psw,
|
| | | StringPwd = UserCenterResourse.Option.PswAuthentication
|
| | | };
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatEexpandPwd", false, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | if (result == false)
|
| | | {
|
| | | contr.SetErrorMsg(string.Empty);
|
| | | }
|
| | | else
|
| | | {
|
| | | UserCenterResourse.Option.GestureAuthentication = psw;
|
| | | UserCenterResourse.Option.Save();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //界面关闭
|
| | | this.CloseForm();
|
| | | });
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面关闭___________________________
|
| | |
|
| | | /// <summary>
|