Переглянути джерело

针对ios出现的微信配置报错,在error里进行刷新处理

zwq 6 роки тому
батько
коміт
d0da83038b
1 змінених файлів з 6 додано та 7 видалено
  1. 6 7
      src/view/index/index.vue

+ 6 - 7
src/view/index/index.vue

@@ -151,18 +151,13 @@
                 ready: false,
                 enterprise_name: '',
                 locationType: false,
+                reLoad: false,//页面刷新
                 url: {
                     getJsapiConfig: '/f/api/wechat/getJsapiConfig',
                     baiduUrl: '/f/api/wechat/getBaiduAddress',
                 }
             };
         },
-        beforeCreate() {
-            if (location.href.indexOf("#") === -1) {
-                location.href = location.href + "#isreload";
-                location.reload();
-            }
-        },
         mounted() {
             //获取链接参数
             // var query = this.$route.query;
@@ -263,8 +258,12 @@
                         });
                         wx.error(function () {
                             this.loading = false;
-                            Toast("微信验证失败");
                             console.log("微信验证失败")
+                            this.reLoad = false;
+                            if(!this.reLoad){
+                                this.reLoad = true;
+                                location.reload();
+                            }
                         })
                     })
                     .catch(() => {