瀏覽代碼

fix redirect

hgh 1 年之前
父節點
當前提交
479f050616
共有 1 個文件被更改,包括 9 次插入 和 3 次删除
  1. 9 3
      src/components/Auth/RegisterStep.vue

+ 9 - 3
src/components/Auth/RegisterStep.vue

@@ -346,7 +346,9 @@ export default {
         .then(() => {
           this.loading = false
           this.$emit('login-success', { user: 'ali' })
-          this.$router.push({ name: 'Public.Home' })
+          if (this.redirect) {
+            this.$router.push({ name: 'Public.Home' })
+          }
           // this.$store.commit('Auth/updateAccessToken', response.data.token.access_token)
           // this.$store.commit('Auth/setAccessToken', response.data.token.access_token)
           // this.$emit('register')
@@ -423,7 +425,9 @@ export default {
       })
         .then(() => {
           this.loading = false
-          this.$router.push({ name: 'Public.Home' })
+          if (this.redirect) {
+            this.$router.push({ name: 'Public.Home' })
+          }
           // this.setRegisterStep('information')
         })
         .catch(() => {
@@ -446,7 +450,9 @@ export default {
         .then(() => {
           this.loading = false
           this.$emit('login-success', { user: 'ali' })
-          this.$router.push({ name: 'Public.Home' })
+          if (this.redirect) {
+            this.$router.push({ name: 'Public.Home' })
+          }
           // this.setRegisterStep('information')
         })
         .catch(() => {