From 0087dd7734e71dfcfd1bb54db394ad7855021ffd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期五, 24 七月 2020 10:18:08 +0800
Subject: [PATCH] 新版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs |   63 ++++++++++---------------------
 1 files changed, 21 insertions(+), 42 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index b841920..2f61f5d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -22,15 +22,9 @@
         /// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
         /// <param name="obj">涓�涓被</param>
         /// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
-        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
-        public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
+        public static bool GetResultStatuByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
         {
-            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
-            {
-                //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
-                ShowNotNetMsg(listNotShowError);
-                return false;
-            }
             //鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
             var connectMode = GetHttpConnectMode(checkAuthority);
             //鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -39,7 +33,8 @@
             {
                 if (setAgain == false)
                 {
-                    //涓嶆寚瀹氶噸鍙�
+                    //褰撳墠鏃犳硶璁块棶缃戠粶
+                    ShowNotNetMsg(listNotShowError);
                     return false;
                 }
                 byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -61,17 +56,10 @@
         /// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
         /// <param name="obj">涓�涓被</param>
         /// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
-        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
+        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
         /// </param>
-        public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+        public static string GetResultCodeByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
         {
-            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
-            {
-                //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
-                ShowNotNetMsg(listNotShowError);
-                return "Error";
-            }
-
             //鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
             var connectMode = GetHttpConnectMode(checkAuthority);
             //鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -80,7 +68,8 @@
             {
                 if (setAgain == false)
                 {
-                    //涓嶆寚瀹氶噸鍙�
+                    //褰撳墠鏃犳硶璁块棶缃戠粶
+                    ShowNotNetMsg(listNotShowError);
                     return "Error";
                 }
                 byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -105,16 +94,10 @@
         /// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
         /// <param name="obj">涓�涓被</param>
         /// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
-        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
+        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
         /// </param>
-        public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+        public static string GetResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
         {
-            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
-            {
-                //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
-                ShowNotNetMsg(listNotShowError);
-                return null;
-            }
             //鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
             var connectMode = GetHttpConnectMode(checkAuthority);
             //鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -123,7 +106,8 @@
             {
                 if (setAgain == false)
                 {
-                    //涓嶆寚瀹氶噸鍙�
+                    //褰撳墠鏃犳硶璁块棶缃戠粶
+                    ShowNotNetMsg(listNotShowError);
                     return null;
                 }
                 byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -154,15 +138,9 @@
         /// <param name="checkAuthority">鏄惁妫�娴嬫潈闄愶紝璇ュ弬鏁颁笉鑳界渷鐣�</param>
         /// <param name="obj">涓�涓被</param>
         /// <param name="listNotShowError">涓嶉渶瑕佹樉绀洪敊璇殑閿欒绫诲埆(鎺ュ彛杩斿洖鐨勯敊璇被鍒�),濡傛灉鍖呭惈锛屽垯浼氳繑鍥炪�恡rue銆�</param>
-        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿涓嶉噸鍙�</param>
-        public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = false)
+        /// <param name="setAgain">褰撳彂閫佸け璐ユ椂,鏄惁閲嶅彂,榛樿閲嶅彂</param>
+        public static byte[] GetByteResponseDataByRequestHttps(string RequestName, bool checkAuthority, object obj, List<string> listNotShowError = null, bool setAgain = true)
         {
-            if (HdlWifiLogic.Current.CanAccessHttp == false && setAgain == false)
-            {
-                //褰撳墠鏃犳硶璁块棶缃戠粶(褰撻渶瑕侀噸鏂板彂閫佹椂,璺宠繃杩欎釜鍒ゆ柇)
-                ShowNotNetMsg(listNotShowError);
-                return null;
-            }
             //鑾峰彇鎺ュ彛鐨勮繛鎺ユā寮�
             var connectMode = GetHttpConnectMode(checkAuthority);
             //鑾峰彇浠庢帴鍙i偅閲屽彇鍒扮殑姣旂壒鏁版嵁
@@ -172,7 +150,8 @@
             {
                 if (setAgain == false)
                 {
-                    //涓嶆寚瀹氶噸鍙�
+                    //褰撳墠鏃犳硶璁块棶缃戠粶
+                    ShowNotNetMsg(listNotShowError);
                     return null;
                 }
                 revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -537,7 +516,7 @@
             //鏂紑杩滅▼Mqtt杩炴帴,閲嶆柊杩炴帴
             HdlThreadLogic.Current.RunThread(async () =>
             {
-                HdlGatewayLogic.Current.ClearAllRealGateway();
+                HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                 await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
             }, ShowErrorMode.NO);
         }
@@ -618,7 +597,7 @@
 
                 //娓呯┖褰撳墠浣忓畢id
                 Config.Instance.HomeId = string.Empty;
-                HdlGatewayLogic.Current.ClearAllRealGateway();
+                HdlGatewayLogic.Current.ClearAllRealGatewayConection(false);
 
                 //鏂紑杩滅▼Mqtt杩炴帴
                 HdlThreadLogic.Current.RunThread(async () =>
@@ -674,8 +653,8 @@
                 }
                 else if (view is UserView.UserPage)
                 {
-                    var form = ((UserView.UserPage)view).GetNowActionForm();
-                    form?.FormActionAgainEvent();
+                    //鍒锋柊涓婚〉
+                    UserView.UserPage.Instance.ReFreshControl();
                     return;
                 }
                 else
@@ -861,7 +840,7 @@
                 //鏂紑杩滅▼Mqtt杩炴帴,閲嶆柊杩炴帴
                 HdlThreadLogic.Current.RunThread(async () =>
                 {
-                    HdlGatewayLogic.Current.ClearAllRealGateway();
+                    HdlGatewayLogic.Current.ClearAllRealGatewayConection(true);
                     await ZigBee.Device.ZbGateway.DisConnectRemoteMqttClient();
                 }, ShowErrorMode.NO);
 

--
Gitblit v1.8.0