瀏覽代碼

未登录添加跳转

xinfeng 5 年之前
父節點
當前提交
7b449ae031
共有 2 個文件被更改,包括 7 次插入1 次删除
  1. 1 1
      pages/otherpage/companyComplete/index.vue
  2. 6 0
      plugins/common.js

+ 1 - 1
pages/otherpage/companyComplete/index.vue

@@ -94,7 +94,7 @@
     async created() {
     },
     async mounted() {
-      await this.needLogin()
+      await this.needLoginQrcode()
       this.getInfo()
     },
     methods: {

+ 6 - 0
plugins/common.js

@@ -42,6 +42,12 @@ Vue.mixin({
         this.goLogin();
       }
     },
+    async needLoginQrcode() {
+      const userInfo = await this.getUserInfo();
+      if (!userInfo || !userInfo.nickname) {
+        location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show&scan=1&next=' + encodeURIComponent(location.href)
+      }
+    },
     async checkLogin(goLogin = false) {
       const userInfo = await this.getUserInfo();
       if (!userInfo || !userInfo.nickname) {