浏览代码

登录跳转至原页面

yangc 8 年之前
父节点
当前提交
11a719ae48
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      components/mobile/common/LoginBox.vue
  2. 1 1
      pages/auth/login.vue

+ 1 - 1
components/mobile/common/LoginBox.vue

@@ -16,7 +16,7 @@
         this.$emit('onLoginBoxClose')
       },
       goLogin: function () {
-        this.$router.push('/auth/login')
+        this.$router.push('/auth/login?returnUrl=' + window.location.href)
       }
     }
   }

+ 1 - 1
pages/auth/login.vue

@@ -8,7 +8,7 @@
     name: 'login',
     layout: 'login',
     mounted () {
-      let uri = window.location.protocol + '//' + window.location.host + '/'
+      let uri = this.$route.query.returnUrl ? this.$route.query.returnUrl : window.location.protocol + '//' + window.location.host + '/'
       this.$http.get('/login/page', {params: {returnUrl: uri}}).then(response => {
         if (response.data) {
           window.location.href = response.data.content + '&baseUrl=' + encodeURIComponent(window.location.protocol + '//' + window.location.host + response.data.baseUrl)