浏览代码

退出登录

guodong 1 年之前
父节点
当前提交
8ef41b1b7a
共有 1 个文件被更改,包括 9 次插入3 次删除
  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;
             FieldDataManager.Instance.waitToShowFieldFightEndView = false;
             GameGlobal.AutoSevenDayLoginView = true;
             GameGlobal.AutoSevenDayLoginView = true;
@@ -313,8 +313,14 @@ namespace GFGGame
             GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
             GameGlobal.zoneScene.GetComponent<AccountInfoComponent>()?.Clear();
             if (logout)
             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.Hide<GuideView>();
             ViewManager.Show<LoginView>(null, null, true);
             ViewManager.Show<LoginView>(null, null, true);