Browse Source

登录优化

guodong 3 years ago
parent
commit
692ecc6924

+ 10 - 3
GameClient/Assets/Game/HotUpdate/Platform/PlatformTapManager.cs

@@ -60,10 +60,17 @@ namespace GFGGame
             }
             catch (Exception e)
             {
-                if (e is TapException error)
+                if (e is TapException tapError)
                 {
-                    Log.Error($"Login Error:{error.code} message:{error.message}");
-                    PromptController.Instance.ShowFloatTextPrompt(error.message);
+                    if (tapError.code == (int)TapErrorCode.ERROR_CODE_BIND_CANCEL) // 取消登录
+                    {
+                        Log.Debug("登录取消");
+                    }
+                    else
+                    {
+                        Log.Error($"Login Error:{tapError.code} message:{tapError.message}");
+                        PromptController.Instance.ShowFloatTextPrompt(tapError.message);
+                    }
                 }
                 else
                 {

+ 16 - 9
GameClient/Assets/Game/HotUpdate/Views/Login/LoginView.cs

@@ -146,20 +146,27 @@ namespace GFGGame
             ViewManager.Show<SystemNoticeView>(new object[] { NoticeDataManager.Instance.LastNoticeInfo.title, NoticeDataManager.Instance.LastNoticeInfo.content });
         }
 
-        private async void OnClickBtnStart()
+        private void OnClickBtnStart()
         {
-            var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
-            if (serverInfosComponent.ServerInfoList.Count <= 0)
+            if (PlatformManager.IsTaptap)//taptap平台
             {
-                bool login = GameController.CheckLoginCache(true);
-                if (!login)
-                {
-                    ViewManager.Show<LoginInputView>();
-                }
+                LoginController.GetRoles().Coroutine();
             }
             else
             {
-                await LoginController.GetRoles();
+                var serverInfosComponent = GameGlobal.zoneScene.GetComponent<ServerInfosComponent>();
+                if (serverInfosComponent.ServerInfoList.Count <= 0)
+                {
+                    bool login = GameController.CheckLoginCache(true);
+                    if (!login)
+                    {
+                        ViewManager.Show<LoginInputView>();
+                    }
+                }
+                else
+                {
+                    LoginController.GetRoles().Coroutine();
+                }
             }
         }