Răsfoiți Sursa

退出登录

guodong 1 an în urmă
părinte
comite
8ef41b1b7a

+ 9 - 3
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -261,7 +261,7 @@ namespace GFGGame
 
         }
 
-        public static void QuitToLoginView(bool logout)
+        public static void QuitToLoginView(bool logout, bool fromSdkLogoutCallback = false)
         {
             FieldDataManager.Instance.waitToShowFieldFightEndView = false;
             GameGlobal.AutoSevenDayLoginView = true;
@@ -313,8 +313,14 @@ namespace GFGGame
             GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
             if (logout)
             {
-                QDManager.Logout();
-                PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
+                if (PlayerPrefs.HasKey(GameConst.PASSWORD_LAST_LOGIN_KEY))
+                {
+                    PlayerPrefs.DeleteKey(GameConst.PASSWORD_LAST_LOGIN_KEY);
+                }
+                if (!fromSdkLogoutCallback)
+                {
+                    QDManager.Logout();
+                }
             }
             ViewManager.Hide<GuideView>();
             ViewManager.Show<LoginView>(null, null, true);