Bläddra i källkod

修改登录、退出参数

yangc 8 år sedan
förälder
incheckning
40a7cfa6aa

+ 1 - 1
components/common/buyOrCar/buyComponent.vue

@@ -13,7 +13,7 @@
         if (!this.$store.state.option.user.logged) {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              window.location.href = response.data.content
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 2 - 3
components/default/Header.vue

@@ -79,15 +79,14 @@
       logout () {
         this.$http.get('/logout/crossBefore').then(response => {
           if (response.data) {
-            window.location.href = response.data.logoutUrl
+            window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
       },
       onLoginClick () {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            console.log(response.data.content)
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
         // TODO 待Account Center改版

+ 1 - 1
components/default/RightBar.vue

@@ -148,7 +148,7 @@
       goLogin: function () {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
       },

+ 2 - 2
components/product/component/ComponentDetail.vue

@@ -111,7 +111,7 @@
         } else {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              window.location.href = response.data.content
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
             }
           })
         }
@@ -120,7 +120,7 @@
         if (url === '1') {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              window.location.href = response.data.content
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 1 - 1
components/provider/NewStore.vue

@@ -57,7 +57,7 @@ export default {
       if (!this.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 1 - 1
components/searchStore/StoreContent.vue

@@ -97,7 +97,7 @@
         if (!this.user.logged) {
           this.$http.get('/login/page').then(response => {
             if (response.data) {
-              window.location.href = response.data.content
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 1 - 1
components/store/CommodityInfo.vue

@@ -310,7 +310,7 @@ export default {
       if (!this.$store.state.option.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 1 - 1
components/store/RecommendProduct.vue

@@ -72,7 +72,7 @@
         if (!this.$store.state.option.user.logged) {
           this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
             if (response.data) {
-              window.location.href = response.data.content
+              window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
             }
           })
         } else {

+ 1 - 1
components/store/common/StoreHeader.vue

@@ -100,7 +100,7 @@ export default {
       if (!this.user.logged) {
         this.$http.get('/login/page', {params: {returnUrl: window.location.href}}).then(response => {
           if (response.data) {
-            window.location.href = response.data.content
+            window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.host + response.data.baseUrl)
           }
         })
       } else {

+ 1 - 1
middleware/authenticated.js

@@ -6,7 +6,7 @@ export default function ({ isServer, store, req, redirect }) {
   if (!store.state.option.user.logged) {
     this.$http.get('/logout/crossBefore').then(response => {
       if (response.data) {
-        window.location.href = response.data.logoutUrl
+        window.location.href = response.data.logoutUrl + encodeURIComponent(window.location.host + response.data.baseUrl)
       }
     })
   }