Browse Source

修改login

tang biao 6 years ago
parent
commit
eddecc1ed7
2 changed files with 13 additions and 11 deletions
  1. 12 10
      assets/scripts/login/LoginCtrl.js
  2. 1 1
      assets/scripts/login/LoginCtrl.js.meta

+ 12 - 10
assets/scripts/login/LoginCtrl.js

@@ -192,7 +192,6 @@ cc.Class({
         if(CC_WECHATGAME) {
             this._startWxLogin();
         } else if (CC_QQPLAY) {
-            BK.Script.log('游戏开始登录');
             QQPlayer.qqLogin((isError) => {
                 if (isError) {
                     this._getDataFail();
@@ -277,13 +276,17 @@ cc.Class({
 
     _getUserInfoAndStartGame() {
         if (GameGlobal.user == undefined || GameGlobal.user.uid == undefined) {
-            weChat.login((isError) => {
-                if (isError) {
-                    this._getDataFail();
-                } else {
-                    this._getUserInfoAndStartGame();
-                }
-            });
+            if (CC_QQPLAY) {
+                this.startLogin();
+            } else if (CC_WECHATGAME) {
+                weChat.login((isError) => {
+                    if (isError) {
+                        this._getDataFail();
+                    } else {
+                        this._getUserInfoAndStartGame();
+                    }
+                });
+            }
             return;
         }
 
@@ -371,9 +374,8 @@ cc.Class({
     },
 
     restartGame() {
-        this.startLogin();
         this.restartButton.interactable = false;
-        // this._getUserInfoAndStartGame();
+        this._getUserInfoAndStartGame();
     },
 
     getUserBuildings() {

+ 1 - 1
assets/scripts/login/LoginCtrl.js.meta

@@ -1,6 +1,6 @@
 {
   "ver": "1.0.5",
-  "uuid": "92fe3c98-9b2a-4986-ba06-51f581012f22",
+  "uuid": "bbccadf7-f61f-4765-9da6-c94ce0d0725d",
   "isPlugin": false,
   "loadPluginInWeb": true,
   "loadPluginInNative": true,