From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 十一月 2019 15:36:28 +0800
Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了

---
 ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs |   62 +++++++++++++++++++++++++++----
 1 files changed, 54 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
index 074ea87..1083b47 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
+++ b/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>

--
Gitblit v1.8.0