| | |
| | | public void ShowForm()
|
| | | {
|
| | | //界面右划不可
|
| | | UserView.HomePage.Instance.ScrollEnabled = false;
|
| | | this.ScrollEnabled = false;
|
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uGestureAuthentication));
|
| | |
|
| | | if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == false)
|
| | | if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.GestureAuthentication) == false)
|
| | | {
|
| | | formMode = FormMode.A验证前回密码;
|
| | | }
|
| | |
| | | form.AddForm();
|
| | | };
|
| | | //底线
|
| | | int lineWidth = btnForgotPsw.GetRealWidthByText(12);
|
| | | int lineWidth = btnForgotPsw.GetRealWidthByText();
|
| | | var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
|
| | | btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
|
| | | btnLine.Gravity = Gravity.CenterHorizontal;
|
| | |
| | | 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验证前回密码)
|
| | | {
|
| | | if (UserCenterResourse.Option.GestureAuthentication != i_Psw)
|
| | | if (UserCenterResourse.AccountOption.GestureAuthentication != i_Psw)
|
| | | {
|
| | | UserCenterResourse.Option.PasswordGestureInputCount--;
|
| | | if (UserCenterResourse.Option.PasswordGestureInputCount <= 0)
|
| | | UserCenterResourse.AccountOption.PasswordGestureInputCount--;
|
| | | if (UserCenterResourse.AccountOption.PasswordGestureInputCount <= 0)
|
| | | {
|
| | | //管理员身份验证失败,请重新登录
|
| | | string msg2 = Language.StringByID(R.MyInternationalizationString.uCheckAdministratorFailAndReload);
|
| | |
| | | return;
|
| | | }
|
| | | //重置剩余密码次数
|
| | | UserCenterResourse.Option.ResetPasswordCount();
|
| | | UserCenterResourse.AccountOption.ResetPasswordCount();
|
| | |
|
| | | formMode = FormMode.A修改密码;
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | | else if (formMode == FormMode.A修改密码)
|
| | | {
|
| | | if (i_Psw == UserCenterResourse.AccountOption.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 ■ 界面关闭___________________________
|
| | | #region ■ 保存密码___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 界面关闭
|
| | | /// 保存密码
|
| | | /// </summary>
|
| | | public override void CloseForm()
|
| | | /// <param name="contr">控件</param>
|
| | | /// <param name="psw">密码</param>
|
| | | private void SaveSecondaryPassword(PswGestureInputControl contr, string psw)
|
| | | {
|
| | | //界面右划可
|
| | | UserView.HomePage.Instance.ScrollEnabled = true;
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var pra = new
|
| | | {
|
| | | RequestVersion = Common.CommonPage.RequestVersion,
|
| | | LoginAccessToken = Common.Config.Instance.Token,
|
| | | GesturePwd = psw,
|
| | | StringPwd = UserCenterResourse.AccountOption.PswAuthentication
|
| | | };
|
| | | var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatEexpandPwd", false, pra);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | base.CloseForm();
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (result == false)
|
| | | {
|
| | | contr.SetErrorMsg(string.Empty);
|
| | | }
|
| | | else
|
| | | {
|
| | | UserCenterResourse.AccountOption.GestureAuthentication = psw;
|
| | | UserCenterResourse.AccountOption.Save();
|
| | | //界面关闭
|
| | | this.CloseForm();
|
| | | }
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|