浏览代码

modify pc dead loop

quyueting 5 年之前
父节点
当前提交
6e69c701ed
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 1 1
      minigame/WebContent/index.html
  2. 7 1
      minigame/WebContent/js/main.js

+ 1 - 1
minigame/WebContent/index.html

@@ -125,7 +125,7 @@
     <script src="./js/tweenmax.js"></script>
     <script src="./js/wechat.js"></script>
     <script src="./assets.js"></script>
-    <script src="./js/main.js"></script>
+    <script src="./js/main.js?v=1"></script>
     <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
     <script>
         // 判断微信分享

+ 7 - 1
minigame/WebContent/js/main.js

@@ -676,7 +676,9 @@ function handleComplete(evt, comp) {
 
 function getInfo() {
     var ua = navigator.userAgent.toLowerCase();
+    var isMobile = false;
     if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
+    	isMobile = true;
         if (ua.match(/MicroMessenger/i) == "micromessenger") {
             type = 0;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
@@ -705,6 +707,7 @@ function getInfo() {
                 +"scope=snsapi_userinfo&"//snsapi_userinfo
                 +"state=1#wechat_redirect";
         }
+        
     }
 
     if(URLParams['uid']) {
@@ -740,7 +743,10 @@ function getInfo() {
         $('.secret-btn').show();
 
         init();
-        getMsg();
+        if (isMobile) {
+        	getMsg();
+        }
+        
     }
 
 }