HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-13 8b9ce384b26c414db32f98e94e088f5334869c2d
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
@@ -146,10 +146,8 @@
                    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验证前回密码)
            {
@@ -176,6 +174,12 @@
            }
            else if (formMode == FormMode.A修改密码)
            {
                if (i_Psw == UserCenterResourse.Option.GestureAuthentication)
                {
                    //新密码和原密码一致,请重新输入
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uNewPswAndOldPswIsEqual));
                    return;
                }
                if (pswLength <= 4)
                {
                    //手势密码长度必须大于4
@@ -196,10 +200,8 @@
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uGestureNotEqual));
                    return;
                }
                UserCenterResourse.Option.GestureAuthentication = i_Psw;
                UserCenterResourse.Option.Save();
                //关闭界面
                this.CloseForm();
                //保存密码
                this.SaveSecondaryPassword(pswControl, i_Psw);
            }
        }
@@ -218,6 +220,50 @@
        #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>