From 48ba446936b51fffafa7c3600c0dadc6ac0e8c20 Mon Sep 17 00:00:00 2001 From: 陈嘉乐 <cjl@hdlchina.com.cn> Date: 星期五, 10 七月 2020 10:52:13 +0800 Subject: [PATCH] 2020-07-10-01 --- ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs | 73 +++++++++++++++++++++++++++++------- 1 files changed, 59 insertions(+), 14 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs index 074ea87..c2f91ae 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs @@ -32,7 +32,7 @@ //璁剧疆澶撮儴淇℃伅 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPasswordAuthentication)); - if (string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == false) + if (string.IsNullOrEmpty(UserCenterResourse.AccountOption.PswAuthentication) == false) { formMode = FormMode.A楠岃瘉鍓嶅洖瀵嗙爜; } @@ -102,7 +102,7 @@ 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; @@ -137,17 +137,15 @@ 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楠岃瘉鍓嶅洖瀵嗙爜) { - if (UserCenterResourse.Option.PswAuthentication != i_Psw) + if (UserCenterResourse.AccountOption.PswAuthentication != i_Psw) { - UserCenterResourse.Option.PasswordInputCount--; - if (UserCenterResourse.Option.PasswordInputCount <= 0) + UserCenterResourse.AccountOption.PasswordInputCount--; + if (UserCenterResourse.AccountOption.PasswordInputCount <= 0) { //绠$悊鍛樿韩浠介獙璇佸け璐�,璇烽噸鏂扮櫥褰� string msg2 = Language.StringByID(R.MyInternationalizationString.uCheckAdministratorFailAndReload); @@ -160,13 +158,19 @@ return; } //閲嶇疆鍓╀綑瀵嗙爜娆℃暟 - UserCenterResourse.Option.ResetPasswordCount(); + UserCenterResourse.AccountOption.ResetPasswordCount(); formMode = FormMode.A淇敼瀵嗙爜; this.InitMiddleFrame(); } else if (formMode == FormMode.A淇敼瀵嗙爜) { + if (i_Psw == UserCenterResourse.AccountOption.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,49 @@ #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.AccountOption.GestureAuthentication, + StringPwd = psw + }; + var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatEexpandPwd", false, pra); + //鍏抽棴杩涘害鏉� + this.CloseProgressBar(); + + HdlThreadLogic.Current.RunMain(() => + { + if (result == false) + { + contr.SetErrorMsg(string.Empty); + } + else + { + UserCenterResourse.AccountOption.PswAuthentication = psw; + UserCenterResourse.AccountOption.Save(); + //鐣岄潰鍏抽棴 + this.CloseForm(); + } + }); + }); + } + + #endregion + #region 鈻� 缁撴瀯浣揰____________________________ /// <summary> -- Gitblit v1.8.0