From fb1c35eaa8a1d37b4fa6ea23809c7c8d35c390d1 Mon Sep 17 00:00:00 2001 From: gtz <535262213@qq.com> Date: Thu, 3 Nov 2022 16:16:18 +0800 Subject: [PATCH] 'update' --- src/views/login.vue | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) 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(() => {