From 4c17caa61bc3b0a05a2b303bccdfedfbf3853f6d Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期二, 24 十一月 2020 15:58:10 +0800
Subject: [PATCH] 2020-11-24 1.优化登录界面失败提示。

---
 HDL_ON/DAL/Server/IMessageCommon.cs |   45 +++++++++++++++++++++++++++++----------------
 1 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/HDL_ON/DAL/Server/IMessageCommon.cs b/HDL_ON/DAL/Server/IMessageCommon.cs
index ccea3d4..cc5f79c 100644
--- a/HDL_ON/DAL/Server/IMessageCommon.cs
+++ b/HDL_ON/DAL/Server/IMessageCommon.cs
@@ -35,10 +35,10 @@
         /// </summary>
         public bool IgnoreError = false;
 
-        /// <summary>
-        /// 鍏ㄩ儴淇℃伅
-        /// </summary>
-        private Dictionary<string, Dictionary<string, int>> dicMsg = null;
+        ///// <summary>
+        ///// 鍏ㄩ儴淇℃伅
+        ///// </summary>
+        //private Dictionary<string, Dictionary<string, int>> dicMsg = null;
 
         /// <summary>
         /// 閫氱敤閿欒鐮�
@@ -51,7 +51,7 @@
         /// </summary>
         public void InitAllMsg()
         {
-            dicMsg = new Dictionary<string, Dictionary<string, int>>();
+            //dicMsg = new Dictionary<string, Dictionary<string, int>>();
             #region 鍏遍�氶敊璇爜
             stateCodeDic = new Dictionary<string, int>();
             //涓庢湇鍔″櫒閫氳澶辫触
@@ -62,17 +62,23 @@
             #region 鍩虹鏈嶅姟 鏂伴敊璇爜
             //绯荤粺缁存姢涓瓇璇风◢鍚庡啀璇晘
             stateCodeDic["2"] = HDL_ON.StringId.SystemMaintenance;
+            //绛惧悕閿欒
+            stateCodeDic["4"] = HDL_ON.StringId.SignatureError;
             //楠岃瘉鐮佹牎楠屽け璐�
             stateCodeDic["14"] = HDL_ON.StringId.VerificationCodeWrong;
             //楠岃瘉鐮佸彂閫侀绻侊紝璇风◢鍚庡啀璇曪紒
             stateCodeDic["15"] = HDL_ON.StringId.VerificationCodeSentFrequently;
+            //浼氳瘽瓒呮椂锛岃鏇存柊token
+            stateCodeDic["10001"] = HDL_ON.StringId.NotLogin;
             ////鐧诲綍澶辫触锛岃处鍙锋垨鑰呭瘑鐮侀敊璇�
             stateCodeDic["10008"] = HDL_ON.StringId.LoginFailed_AccountOrPasswordError;
             //璐﹀彿涓嶅瓨鍦�
             stateCodeDic[StateCode.ACCOUNT_NOT_EXIST] = HDL_ON.StringId.AccountNotExist;
             //璐﹀彿宸插瓨鍦�
             stateCodeDic["10012"] = HDL_ON.StringId.AccountExist;
-            //#endregion
+            ////璋冪敤鐢ㄦ埛妯″潡鎺ュ彛澶辫触
+            //stateCodeDic["10213"] = HDL_ON.StringId;
+            #endregion
 
             ////return;
             //#region 2020-09-18 鏂板鎺ラ敊璇爜
@@ -180,7 +186,6 @@
 
             #endregion
 
-            #endregion
 
         }
 
@@ -191,7 +196,7 @@
         /// <param name="revertObj">浜戠杩斿洖鐨勬暟鎹�</param>
         /// <param name="pra">璇锋眰鍙傛暟</param>
         /// <returns></returns>
-        public string GetMsgByRequestName(string requestName, string statuCode)
+        public string GetMsgByRequestName(string statuCode)
         {
             if (IgnoreError == true)
             {
@@ -205,11 +210,11 @@
                 return Language.StringByID(stateCodeDic[statuCode]);
             }
 
-            if (dicMsg.ContainsKey(requestName) == true && dicMsg[requestName].ContainsKey(statuCode) == true)
-            {
-                //鍦ㄥ唽鐨凪sg
-                return Language.StringByID(dicMsg[requestName][statuCode]);
-            }
+            //if (dicMsg.ContainsKey(requestName) == true && dicMsg[requestName].ContainsKey(statuCode) == true)
+            //{
+            //    //鍦ㄥ唽鐨凪sg
+            //    return Language.StringByID(dicMsg[requestName][statuCode]);
+            //}
 
             return Language.StringByID(HDL_ON.StringId.FailedRequestServer) + "\n(" + statuCode + ")";
         }
@@ -222,11 +227,11 @@
         /// <param name="statuCode"></param>
         /// <param name="isTipStyle"></param>
         /// <param name="tipStr">琛ュ厖鐨勯敊璇彁绀�</param>
-        public void ShowErrorInfoAlter(string requestName, string statuCode, bool isTipStyle = false, string tipStr = "")
+        public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "")
         {
             try
             {
-                string mes = GetMsgByRequestName(requestName, statuCode);
+                string mes = GetMsgByRequestName(statuCode);
                 if (mes == null) return;
                 if (!string.IsNullOrEmpty(tipStr))
                 {
@@ -234,7 +239,15 @@
                 }
                 if (isTipStyle)
                 {
-                    //MainPage.AddTip(mes);
+                    Application.RunOnMainThread(() => {
+                        var tip = new Tip()
+                        {
+                            Text = mes,
+                            CloseTime = closeTime,
+                            Direction = AMPopTipDirection.None
+                        };
+                        tip.Show(MainPage.BaseView);
+                    });
                 }
                 else
                 {

--
Gitblit v1.8.0