From f60ce72c3c29c7d31a046795c88ec39a69e73d45 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 06 一月 2021 17:33:54 +0800
Subject: [PATCH] 2021-01-06 1.替换新云端前期准备相关接口,和修改相关参数。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountModifyPassword.cs |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountModifyPassword.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountModifyPassword.cs
index 1a5b54c..e1edea3 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountModifyPassword.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountModifyPassword.cs
@@ -1,5 +1,5 @@
 锘縰sing System;
-using service.hdlcontrol.com_push;
+//using service.hdlcontrol.com_push;
 
 namespace Shared.SimpleControl.Phone
 {
@@ -169,7 +169,12 @@
                     if (string.IsNullOrEmpty (etNewPassword.Text.Trim ())) {
                         new Alert ("", Language.StringByID (R.MyInternationalizationString.NewPasswordIsEmpty),
                                Language.StringByID (R.MyInternationalizationString.Close)).Show ();
-                    }else if (!CommonUtlis.Current.CheckPassword (etNewPassword.Text.Trim ())) {
+                    } else if (!string.IsNullOrEmpty(MainPage.LoginUser.Name) && etNewPassword.Text.Trim ().Contains (MainPage.LoginUser.Name)) {
+                        //瀵嗙爜涓嶈兘鍖呭惈鐢ㄦ埛鍚�
+                        new Alert ("", ErrorCode.PasswordNotUsername,
+                                   Language.StringByID (R.MyInternationalizationString.Close)).Show ();
+                        return;
+                    } else if (!CommonUtlis.Current.CheckPassword (etNewPassword.Text.Trim ())) {
                         new Alert ("", ErrorCode.PasswordStrengthNotMatch,
                                    Language.StringByID (R.MyInternationalizationString.Close)).Show ();
                         //return;
@@ -183,7 +188,7 @@
                             var requestObj = new UpdatePasswordObj () { OldPassword = oldPassword, NewPassword = newPassword };
                             var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject (requestObj);
                             var revertObj = MainPage.RequestHttps (API.UpdatePassword, requestJson);
-                            if (revertObj.StateCode.ToUpper() == "SUCCESS") {
+                            if (revertObj.StateCode.ToUpper() == StateCode.SUCCESS) {
                                 MainPage.LoginUser.Password = newPassword;
                                 MainPage.LoginUser.SaveUserInfo ();
                                 Application.RunOnMainThread (() => {

--
Gitblit v1.8.0