瀏覽代碼

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

zhangyuqian 1 年之前
父節點
當前提交
2dfc9a8ccd

+ 4 - 4
GameClient/Assets/Game/HotUpdate/Controller/LoginController.cs

@@ -42,7 +42,7 @@ namespace GFGGame
             }
             else
             {
-                OnLoginFail(errorCode);
+                OnLoginFail(errorCode, account);
             }
         }
 
@@ -82,7 +82,7 @@ namespace GFGGame
             }
             else
             {
-                OnLoginFail(errorCode);
+                OnLoginFail(errorCode, account);
             }
         }
 
@@ -124,14 +124,14 @@ namespace GFGGame
             return;
         }
 
-        private static void OnLoginFail(int errorCode)
+        private static void OnLoginFail(int errorCode, string account)
         {
             ViewManager.Hide<ModalStatusView>();
             if (ErrorCodeController.Handler(errorCode))
             {
                 GameController.QuitToLoginView(true);
             }
-            EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL);
+            EventAgent.DispatchEvent(ConstMessage.LOGIN_FAIL, account);
         }
 
         public static async ETTask Register(string account, string password, string name, string identityNum, string code)

+ 21 - 0
GameClient/Assets/Game/HotUpdate/Views/Login/LoginInputView.cs

@@ -47,6 +47,20 @@ namespace GFGGame
             base.OnHide();
         }
 
+
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.LOGIN_FAIL, OnLoginFail);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+
+            EventAgent.RemoveEventListener(ConstMessage.LOGIN_FAIL, OnLoginFail);
+        }
+
         private void OnClickBtnSure()
         {
             var account = _ui.m_inputAccount.text;
@@ -100,5 +114,12 @@ namespace GFGGame
         {
             ViewManager.Show<RegisterView>();
         }
+
+        private void OnLoginFail(EventContext context)
+        {
+            string account = (string)context.data;
+            _ui.m_inputAccount.text = account;
+        }
+
     }
 }