HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-13 8b9ce384b26c414db32f98e94e088f5334869c2d
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
@@ -137,10 +137,8 @@
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.SecondPswNotEqual2));
                    return;
                }
                UserCenterResourse.Option.PswAuthentication = i_Psw;
                UserCenterResourse.Option.Save();
                //关闭界面
                this.CloseForm();
                //保存密码
                this.SaveSecondaryPassword(pswControl, i_Psw);
            }
            else if (formMode == FormMode.A验证前回密码)
            {
@@ -167,6 +165,12 @@
            }
            else if (formMode == FormMode.A修改密码)
            {
                if (i_Psw == UserCenterResourse.Option.PswAuthentication)
                {
                    //新密码和原密码一致,请重新输入
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uNewPswAndOldPswIsEqual));
                    return;
                }
                //输入二次密码
                this.firstPssword = i_Psw;
                formMode = FormMode.A确认修改密码;
@@ -180,10 +184,8 @@
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.SecondPswNotEqual2));
                    return;
                }
                UserCenterResourse.Option.PswAuthentication = i_Psw;
                UserCenterResourse.Option.Save();
                //关闭界面
                this.CloseForm();
                //保存密码
                this.SaveSecondaryPassword(pswControl, i_Psw);
            }
        }
@@ -202,6 +204,50 @@
        #endregion
        #region ■ 保存密码___________________________
        /// <summary>
        /// 保存密码
        /// </summary>
        /// <param name="contr">控件</param>
        /// <param name="psw">密码</param>
        private void SaveSecondaryPassword(PswNumberInputControl contr, string psw)
        {
            HdlThreadLogic.Current.RunThread(async () =>
            {
                //打开进度条
                this.ShowProgressBar();
                var pra = new
                {
                    RequestVersion = Common.CommonPage.RequestVersion,
                    LoginAccessToken = Common.Config.Instance.Token,
                    GesturePwd = UserCenterResourse.Option.GestureAuthentication,
                    StringPwd = psw
                };
                var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatEexpandPwd", false, pra);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
                {
                    contr.SetErrorMsg(string.Empty);
                }
                else
                {
                    UserCenterResourse.Option.PswAuthentication = psw;
                    UserCenterResourse.Option.Save();
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        //界面关闭
                        this.CloseForm();
                    });
                }
            });
        }
        #endregion
        #region ■ 结构体_____________________________
        /// <summary>