|
@@ -66,7 +66,16 @@ export default {
|
66
|
66
|
password: [{ required: true, trigger: 'blur', validator: validatePass }]
|
67
|
67
|
},
|
68
|
68
|
loading: false,
|
69
|
|
- pwdType: 'password'
|
|
69
|
+ pwdType: 'password',
|
|
70
|
+ redirect: undefined
|
|
71
|
+ }
|
|
72
|
+ },
|
|
73
|
+ watch: {
|
|
74
|
+ $route: {
|
|
75
|
+ handler: function(route) {
|
|
76
|
+ this.redirect = route.query && route.query.redirect
|
|
77
|
+ },
|
|
78
|
+ immediate: true
|
70
|
79
|
}
|
71
|
80
|
},
|
72
|
81
|
methods: {
|
|
@@ -83,7 +92,7 @@ export default {
|
83
|
92
|
this.loading = true
|
84
|
93
|
this.$store.dispatch('Login', this.loginForm).then(() => {
|
85
|
94
|
this.loading = false
|
86
|
|
- this.$router.push({ path: '/' })
|
|
95
|
+ this.$router.push({ path: this.redirect || '/' })
|
87
|
96
|
}).catch(() => {
|
88
|
97
|
this.loading = false
|
89
|
98
|
})
|