From efad979b6fae76fb37a4de7e94e6bac0a85cb72c Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 30 十一月 2021 13:14:28 +0800
Subject: [PATCH] 2021-11-30 1.修复乐橙Android,没调用拒接接口问题。

---
 HDL_ON/DAL/Server/IMessageCommon.cs |  103 ++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 93 insertions(+), 10 deletions(-)

diff --git a/HDL_ON/DAL/Server/IMessageCommon.cs b/HDL_ON/DAL/Server/IMessageCommon.cs
index 038ae9f..2564a72 100644
--- a/HDL_ON/DAL/Server/IMessageCommon.cs
+++ b/HDL_ON/DAL/Server/IMessageCommon.cs
@@ -64,7 +64,10 @@
             stateCodeDic["NETWORK_ERROR"] = StringId.FailedRequestServer;
             //鏁版嵁寮傚父
             stateCodeDic["DATA_EXCEPTION"] = StringId.DataExceptionPleaseTryAgain;
-
+            //涓庢湇鍔″櫒閫氳澶辫触
+            stateCodeDic[StateCode.NETWORK_ERROR] = StringId.FailedRequestServer;
+            //鏁版嵁寮傚父
+            stateCodeDic[StateCode.DATA_EXCEPTION] = StringId.DataExceptionPleaseTryAgain;
             #region 鍩虹鏈嶅姟 鏂伴敊璇爜 2020-12-07
             //绯荤粺绻佸繖~璇风◢鍚庡啀璇晘
             stateCodeDic["1"] = StringId.SystemIsBusy;
@@ -74,6 +77,8 @@
             //stateCodeDic["3"] = StringId.SystemIsBusy;
             //绛惧悕閿欒
             stateCodeDic["4"] = StringId.SignatureError;
+            //璇锋眰澶辫触锛屽弬鏁板紓甯革紒
+            stateCodeDic["9"] = StringId.RequestFailedParameterException;
             //楠岃瘉鐮佹牎楠屽け璐�
             stateCodeDic[StateCode.VERIFICATION_CODE_WRONG] = StringId.VerificationCodeWrong;
             //楠岃瘉鐮佸彂閫侀绻侊紝璇风◢鍚庡啀璇曪紒
@@ -85,6 +90,8 @@
             stateCodeDic[StateCode.TOKEN_EXPIRED] = StringId.NotLogin;
             //瑙f瀽鐢ㄦ埛韬唤閿欒锛岃閲嶆柊鐧诲綍
             stateCodeDic["10006"] = StringId.InvalidToken;
+            //鎮ㄥ凡鍦ㄥ彟涓�涓澶囩櫥褰�
+            stateCodeDic["10007"] = StringId.LoggedOnOtherDevices;
             //鐧诲綍澶辫触锛岃处鍙锋垨鑰呭瘑鐮侀敊璇�
             stateCodeDic["10008"] = StringId.LoginFailed_AccountOrPasswordError;
             //鐢ㄦ埛宸茬粡琚鐢�
@@ -101,14 +108,23 @@
             stateCodeDic["10014"] = StringId.AccountExist;
             //鍘熷瘑鐮侀敊璇�
             stateCodeDic["10015"] = StringId.OldPwdNoYes;
-            ////缁戝畾鍙风爜閲嶅
-            //stateCodeDic["10016"] = StringId.10016;
-            ////娉ㄥ唽澶辫触
-            //stateCodeDic["10017"] = StringId.10017;
+            //缁戝畾鍙风爜閲嶅
+            stateCodeDic["10016"] = StringId.DuplicateBindingNumber;
+            //娉ㄥ唽澶辫触
+            stateCodeDic["10017"] = StringId.RegistrationFailedPleaseTryAgain;
             ////绉熸埛涓嶅瓨鍦�
             //stateCodeDic["10018"] = StringId.10018;
-            //瀵嗙爜杩炵画杈撻敊娆℃暟宸茶揪鍒�10娆�,鐢ㄦ埛宸茶閿佸畾,璇锋鏃�0鐐瑰悗鍐嶇櫥闄�
+            //瀵嗙爜閿欒娆℃暟杩囧锛岃处鍙疯閿佸畾锛�
             stateCodeDic["10019"] = StringId.AccountLoginLock;
+            //娌℃湁鏉冮檺
+            stateCodeDic["10105"] = StringId.PermissionDenied;
+            //楠岃瘉鐮佸凡缁忓彂閫�
+            stateCodeDic["10207"] = StringId.VerificationCodePrompt;
+            //鍙戦�侀獙璇佺爜閿欒
+            stateCodeDic["10210"] = StringId.VerificationCodeWrong;
+
+
+
 
             ////鏋氫妇绫诲瀷閿欒
             //stateCodeDic["11003"] = StringId.11003;
@@ -133,9 +149,54 @@
             //stateCodeDic["10403"] = StringId.HOME_ID_EXISTS;
             //浣忓畢涓嶅瓨鍦�
             stateCodeDic["10404"] = StringId.Home_NoExists;
+            //浣忓畢娌℃湁缁戝畾缃戝叧
+            stateCodeDic["10503"] = StringId.PleaseBindTheGatewayFirst;
 
             ////璋冪敤鐢ㄦ埛妯″潡鎺ュ彛澶辫触
             //stateCodeDic["10213"] = HDL_ON.StringId;
+
+            //*********缃戝叧*********
+            //缃戝叧涓嶅瓨鍦�
+            stateCodeDic["10506"] = StringId.GatewayDoesNotExist;
+
+
+            //鎺у埗澶辫触
+            stateCodeDic["14007"] = StringId.ControlFailure;
+            //缃戝叧绂荤嚎
+            stateCodeDic["14005"] = StringId.GatewayOffline;
+            //璁惧绂荤嚎
+            stateCodeDic["14006"] = StringId.DeviceOffline;
+
+            //*********鍦烘櫙/鑷姩鍖�*********
+            //鍦烘櫙宸插瓨鍦�
+            stateCodeDic["14501"] = StringId.SceneAlreadyExists;
+            //鑷姩鍖栧凡瀛樺湪
+            stateCodeDic["14502"] = StringId.AutomationAlreadyExists;
+
+            //*********璁惧*********
+            //璁惧鐩爣閲嶅
+            stateCodeDic["10801"] = StringId.DuplicateDeviceTarget;
+            //娌℃湁杩滅▼鎺у埗鏉冮檺
+            stateCodeDic["10802"] = StringId.NoRemoteControlPermission;
+            //璁惧涓嶈兘涓虹┖
+            stateCodeDic["10803"] = StringId.TheDeviceCannotBeEmpty;
+            //鐢ㄦ埛娌℃湁璁惧鐨勬潈闄�
+            stateCodeDic["10804"] = StringId.NotHavePermissionToTheDevice;
+            //璁惧涓嶅瓨鍦�
+            stateCodeDic["10805"] = StringId.TheDeviceDoesNotExist;
+
+            //鎺у埗澶辫触
+            stateCodeDic["20000"] = StringId.ControlFailure;
+            //缃戝叧绂荤嚎
+            stateCodeDic["20001"] = StringId.GatewayOffline;
+            //璁惧绂荤嚎
+            stateCodeDic["20002"] = StringId.DeviceOffline;
+            //spk涓嶆敮鎸佽鍔熻兘
+            stateCodeDic["20101"] = StringId.SpkNotSupportThisFeature;
+            //spk鍔熻兘涓嶆敮鎸佹鍔熻兘鍊�
+            stateCodeDic["20102"] = StringId.SpkNotSupportThisFunctionValue;
+            
+
 
             #endregion
 
@@ -182,7 +243,7 @@
         /// <param name="statuCode"></param>
         /// <param name="isTipStyle"></param>
         /// <param name="tipStr">琛ュ厖鐨勯敊璇彁绀�</param>
-        public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "")
+        public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "",bool showAllMsg = true)
         {
             try
             {
@@ -197,7 +258,13 @@
                     if (mes == null) return;
                     if (!string.IsNullOrEmpty(tipStr))
                     {
-                        mes = tipStr + "\n" + mes;
+                        if (showAllMsg)
+                        {
+                            mes = tipStr + "\n" + mes;
+                        }else
+                        {
+                            mes = tipStr;
+                        }
                     }
                     if (isTipStyle)
                     {
@@ -216,7 +283,7 @@
                     {
                         Application.RunOnMainThread(() =>
                         {
-                            new Alert("", mes, Language.StringByID(StringId.Close)).Show();
+                            new Alert("", mes+$" \r\nCode:{statuCode}", Language.StringByID(StringId.Close)).Show();
                         });
                     }
                 }
@@ -238,7 +305,7 @@
                 try
                 {
                     var success = new HttpServerRequest().RefreshToken();
-                    if (success) {
+                    if (success == StateCode.SUCCESS) {
                         Utlis.WriteLine("RefreshToken success");
                     }
                 }
@@ -261,6 +328,16 @@
     public class StateCode
     {
         /// <summary>
+        /// 缃戠粶璇锋眰寮傚父
+        /// APP鑷畾涔夐敊璇爜
+        /// </summary>
+        public const string NETWORK_ERROR = "-1";
+        /// <summary>
+        /// 鏁版嵁瑙f瀽閿欒
+        /// APP鑷畾涔夐敊璇爜
+        /// </summary>
+        public const string DATA_EXCEPTION = "-2";
+        /// <summary>
         /// 璇锋眰鎴愬姛鐨勭姸鎬佺爜
         /// </summary>
         public const string SUCCESS = "0";
@@ -276,6 +353,12 @@
         /// 璐﹀彿涓嶅瓨鍦ㄧ殑閿欒鐮�
         /// </summary>
         public const string ACCOUNT_NOT_EXIST = "10010";
+        /// <summary>
+        /// 鐧诲綍閿佸畾锛屽瘑鐮侀敊璇鏁拌繃澶�
+        /// 瀵嗙爜杈撳叆閿欒瓒呰繃10娆★紝璇�30鍒嗛挓鍚庨噸璇�!
+        /// </summary>
+        public const string AccountLoginLock = "10019";
+        
 
 
     }

--
Gitblit v1.8.0