Kaynağa Gözat

修复mac变动,有老账号登录,不能正常拉取老账号问题

kaka 4 yıl önce
ebeveyn
işleme
4514514840
1 değiştirilmiş dosya ile 19 ekleme ve 1 silme
  1. 19 1
      assets/script/game/data/LoginData.ts

+ 19 - 1
assets/script/game/data/LoginData.ts

@@ -264,7 +264,25 @@ export class LoginData {
         this.sessionKey = parseData.session_key;
         mk.console.logSingle("[FC]checkLogin decrypt", parseData);
         mk.storage.setStorage(StorageKey.sessionKey, this.sessionKey);
-        this.getUserInfo();
+        if (gData.wechatData.code != null) {
+            if (this.isNew) {
+                console.log('KKKK 1 ', this.uin)
+                this.getUserInfo();
+            }
+            else {
+                console.log('KKKK 2 ', this.uin)
+                this.isNew = false;
+                gData.wechatData.code = null;
+
+                cc.audioEngine.stopAll();
+                //调用Android的更好
+                cc.game.restart();
+            }
+        }
+        else {
+            console.log('KKKK 3 ', this.uin)
+            this.getUserInfo();
+        }
     }
 
     private async getUserInfo() {