Browse Source

未登录跳转到登录新增next参数

xinfeng 5 years ago
parent
commit
c7f0b843e0

+ 1 - 1
pages/kaifain/index.vue

@@ -311,7 +311,7 @@
         //检查登录
         if (!userinfo || !userinfo.uid) {
           this.$message.info('请先登录!')
-          location.href = '/?loginbox=show'
+          location.href = '/?loginbox=show&next=' + encodeURIComponent(location.href)
           return
         }
         //去绑定手机号

+ 1 - 1
pages/recruit/_id.vue

@@ -102,7 +102,7 @@
                 })
             },
             login() {
-                location.href = `https://www.proginn.com/?loginbox=show`
+                location.href = 'https://www.proginn.com/?loginbox=show&next=' + encodeURIComponent(location.href)
             },
             apply() {
                 if (this.applying) {

+ 1 - 1
pages/setting/check/old_mobile.vue

@@ -41,7 +41,7 @@ export default {
   },
   mounted() {
     if (!this.userinfo.nickname) {
-      location.href = '/?loginbox=show'
+      location.href = '/?loginbox=show&next=' + encodeURIComponent(location.href)
     }
   },
   methods: {

+ 4 - 4
plugins/common.js

@@ -60,9 +60,9 @@ Vue.mixin({
           if (app) {
             location.href = 'proginn://login?backToPage=true'
           } else if (location.origin.indexOf('local') !== 1 || location.origin.indexOf('dev') !== 1) {
-            location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show'
+            location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show&next=' + encodeURIComponent(location.href)
           } else {
-            location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show'
+            location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show&next=' + encodeURIComponent(location.href)
           }
         }
         return false
@@ -98,7 +98,7 @@ Vue.mixin({
         if (this.$deviceType.app) {
           location.href = "proginn://login?backToPage=true";
         } else {
-          location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show'
+          location.href = this.$store.state.domainConfig.siteUrl + '/?loginbox=show&next=' + encodeURIComponent(location.href)
         }
       } else {
         this.$message.closeAll()
@@ -110,7 +110,7 @@ Vue.mixin({
             if (that.$deviceType.app) {
               location.href = "proginn://login?backToPage=true";
             } else {
-              location.href = that.$store.state.domainConfig.siteUrl + '/?loginbox=show'
+              location.href = that.$store.state.domainConfig.siteUrl + '/?loginbox=show&next=' + encodeURIComponent(location.href)
             }
           }
         })

+ 1 - 1
plugins/nuxtAxios.js

@@ -77,7 +77,7 @@ export default function ({
         if (process.server) {
           redirect(store.state.domainConfig.siteUrl + "/?loginbox=show");
         } else {
-          location.href = store.state.domainConfig.siteUrl + "/?loginbox=show";
+          location.href = store.state.domainConfig.siteUrl + "/?loginbox=show&next=" + encodeURIComponent(location.href);
         }
       }
       console.log(req && req.url);