Browse Source

退出登录

guodong 1 year ago
parent
commit
8ef41b1b7a
1 changed files with 9 additions and 3 deletions
  1. 9 3
      GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

+ 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);