From e90209beae6a4e822cecb18e6889f8bda23f630e Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期一, 14 十二月 2020 11:16:06 +0800 Subject: [PATCH] 合并了晾衣架(非新云端) --- ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs | 51 +++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 39 insertions(+), 12 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs index 02831e2..093de67 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs @@ -50,7 +50,7 @@ rowOldPsw.Y = Application.GetRealHeight(26); frameBackGroud.AddChidren(rowOldPsw); var txtoldPsw = new TextInputControl(Application.GetRealWidth(800), rowOldPsw.Height); - txtoldPsw.X = HdlControlResourse.XXLeft; + txtoldPsw.X = ControlCommonResourse.XXLeft; txtoldPsw.SecureTextEntry = true; txtoldPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputOldPsw); rowOldPsw.AddChidren(txtoldPsw); @@ -76,7 +76,7 @@ btnForgotPsw.TextID = R.MyInternationalizationString.ForgotPasswordMsg; btnForgotPsw.TextAlignment = TextAlignment.CenterRight; frameBackGroud.AddChidren(btnForgotPsw); - btnForgotPsw.X = bodyFrameLayout.Width - HdlControlResourse.XXLeft - btnForgotPsw.Width; + btnForgotPsw.X = bodyFrameLayout.Width - ControlCommonResourse.XXLeft - btnForgotPsw.Width; btnForgotPsw.ButtonClickEvent += (sender, e) => { var form = new ForgotAccountPasswordForm(); @@ -90,7 +90,7 @@ rowNewPsw.Y = Application.GetRealHeight(236); frameBackGroud.AddChidren(rowNewPsw); var txtNewPsw = new TextInputControl(Application.GetRealWidth(800), rowNewPsw.Height); - txtNewPsw.X = HdlControlResourse.XXLeft; + txtNewPsw.X = ControlCommonResourse.XXLeft; txtNewPsw.SecureTextEntry = true; txtNewPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputNewPassword); rowNewPsw.AddChidren(txtNewPsw); @@ -115,7 +115,7 @@ rowConfirmPsw.Y = rowNewPsw.Bottom + Application.GetRealHeight(10); frameBackGroud.AddChidren(rowConfirmPsw); var txtConfirmPsw = new TextInputControl(Application.GetRealWidth(800), rowConfirmPsw.Height); - txtConfirmPsw.X = HdlControlResourse.XXLeft; + txtConfirmPsw.X = ControlCommonResourse.XXLeft; txtConfirmPsw.SecureTextEntry = true; txtConfirmPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewPassword); rowConfirmPsw.AddChidren(txtConfirmPsw); @@ -152,7 +152,7 @@ return; } //淇濆瓨瀵嗙爜 - this.SavePassword(txtoldPsw.Text, txtConfirmPsw.Text); + this.SavePassword(txtConfirmPsw.Text); }; } @@ -163,13 +163,15 @@ /// <summary> /// 淇濆瓨瀵嗙爜 /// </summary> - /// <param name="i_oldPsw"></param> - /// <param name="i_newPsw"></param> - private void SavePassword(string i_oldPsw, string i_newPsw) + /// <param name="newPassword"></param> + private void SavePassword(string newPassword) { - //缂栬緫瀵嗙爜 - var result = HdlAccountLogic.Current.EditorPassword(i_oldPsw, i_newPsw); - if (result == false) + var pra = new SavePasswordPra(); + pra.NewPassword = newPassword; + + //鏇存敼瀵嗙爜 + bool flage = UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatePassword", false, pra); + if (flage == false) { return; } @@ -178,7 +180,7 @@ this.ShowMassage(ShowMsgType.Remind, msg, () => { //浠庢柊鐧诲綍 - HdlAccountLogic.Current.ReLoginAgain(Common.Config.Instance.Account); + UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account); }, Language.StringByID(R.MyInternationalizationString.Login)); } @@ -213,6 +215,12 @@ this.msgControl.TextID = R.MyInternationalizationString.uPleaseRepeatInputNewPassword; return false; } + if (oldPsw != Common.Config.Instance.Password) + { + //瀵嗙爜閿欒锛岃閲嶆柊杈撳叆 + this.msgControl.TextID = R.MyInternationalizationString.uOldPsswordIsError; + return false; + } if (newPsw != newPsw2) { //纭瀵嗙爜涓嶄竴鑷达紝璇烽噸鏂拌緭鍏� @@ -241,5 +249,24 @@ } #endregion + + #region 鈻� 缁撴瀯浣揰____________________________ + + /// <summary> + /// 淇濆瓨瀵嗙爜鐨勫惎鍔ㄥ弬鏁扮被 + /// </summary> + private class SavePasswordPra + { + /// <summary> + /// 鏃у瘑鐮� + /// </summary> + public string OldPassword = Common.Config.Instance.Password; + /// <summary> + /// 鏂板瘑鐮� + /// </summary> + public string NewPassword = string.Empty; + } + + #endregion } } -- Gitblit v1.8.0