This commit is contained in:
gtz 2022-11-03 16:16:18 +08:00
parent 602f7c3ecf
commit fb1c35eaa8

View File

@ -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(() => {