From 580a4715eeb88e13128e65963834b159768444cf Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 08 一月 2020 10:19:39 +0800
Subject: [PATCH] 2019.1.8
---
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs | 68 ++++++++++++++++++++++++++++-----
1 files changed, 57 insertions(+), 11 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
index 3800429..e13264c 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
@@ -103,7 +103,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;
@@ -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,17 +220,61 @@
#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>
/// 鐣岄潰鍏抽棴
/// </summary>
- public override void CloseForm()
+ public override void CloseFormBefore()
{
//鐣岄潰鍙冲垝鍙�
UserView.HomePage.Instance.ScrollEnabled = true;
- base.CloseForm();
+ base.CloseFormBefore();
}
#endregion
--
Gitblit v1.8.0