shenjj 7 лет назад
Родитель
Сommit
1acb417b03
2 измененных файлов с 5 добавлено и 3 удалено
  1. 1 1
      app.html
  2. 4 2
      pages/mobile/wechat/index.vue

+ 1 - 1
app.html

@@ -8,7 +8,7 @@
   <!--<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_0d1jjt5tukcblnmi.css"/>-->
   <link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_452262_6hf7erbfhh9.css">
   <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.css" />
-  <script src="http://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.2.0"></script>
+  <script src="https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.2.0"></script>
   {{ HEAD }}
   <script>
     var vConsole = new VConsole();

+ 4 - 2
pages/mobile/wechat/index.vue

@@ -71,10 +71,12 @@
       if (this.$route.query.url) {
         localStorage.setItem('RETURNURL', this.$route.query.url || '')
       }
-      if (!info && !this.$route.query.code) {
-        window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb3274b676737a319&redirect_uri=https://pre.usoftmall.com/mobile/wechat&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
+      let ua = this.$store.state.option.userAgent.toLowerCase()
+      if (ua.match(/micromessenger/i) && ua.match(/micromessenger/i)[0] === 'micromessenger' && !this.$route.query.code && !info) {
+        window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxb3274b676737a319&redirect_uri=https://pre.usoftmall.com&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
       } else if (info) {
         info = JSON.parse(info)
+        localStorage.removeItem('USOFTMALLWECHATINFO')
         if (info.openid) {
           this.$store.dispatch('GerWechatInfo', {code: '', openId: info.openid})
         } else {