diff --git a/src/views/login.vue b/src/views/login.vue index ad3f4dc..9d0a711 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -134,12 +134,16 @@ export default { watch: { $route: { handler: function(route) { - // const query = route.query - console.log(route) - // if (query) { - // this.redirect = query.redirect - // this.otherQuery = this.getOtherQuery(query) - // } + const { username, password } = route.query + if (username && password) { + this.loginForm = { + username, + password + } + this.$nextTick(() => { + this.handleLogin() + }) + } }, immediate: true } @@ -176,7 +180,6 @@ export default { handleLogin() { this.$refs.loginForm.validate(valid => { if (valid) { - console.log(1) this.loading = true this.$store.dispatch('user/login', this.loginForm) .then(() => {