浏览代码

feat: 微信公众号h5授权-v2

John-Hong 2 年之前
父节点
当前提交
75988ef71a
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/App.vue

+ 3 - 1
src/App.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <!--    <div @click="send">send</div>-->
-    <router-view v-if="isInit"></router-view>
+    <router-view></router-view>
   </div>
 </template>
 <script>
@@ -64,6 +64,8 @@ export default {
         // 如果用户没有登录的话,我们需要让用户完成授权拿到 openid
         const openid = uni.getStorageSync('openid')
         if (!openid) {
+          // 当进入其他页面时,需要先打开路由展示
+          this.isInit = true
           // 前往授权页面
           this.$router.replace({
             path: '/openWx',