mirror of https://github.com/halo-dev/halo
feat: add the load animation to the login button.
parent
db7a6850fd
commit
cde0d1333d
|
@ -47,6 +47,7 @@
|
||||||
:style="{'animation-delay': '0.3s'}"
|
:style="{'animation-delay': '0.3s'}"
|
||||||
>
|
>
|
||||||
<a-button
|
<a-button
|
||||||
|
:loading="landing"
|
||||||
type="primary"
|
type="primary"
|
||||||
:block="true"
|
:block="true"
|
||||||
@click="handleLogin"
|
@click="handleLogin"
|
||||||
|
@ -139,7 +140,8 @@ export default {
|
||||||
apiModifyVisible: false,
|
apiModifyVisible: false,
|
||||||
defaultApiBefore: window.location.protocol + '//',
|
defaultApiBefore: window.location.protocol + '//',
|
||||||
apiUrl: window.location.host,
|
apiUrl: window.location.host,
|
||||||
resetPasswordButton: false
|
resetPasswordButton: false,
|
||||||
|
landing: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -169,11 +171,17 @@ export default {
|
||||||
this.$message.warn('密码不能为空!')
|
this.$message.warn('密码不能为空!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
this.landing = true
|
||||||
this.login({ username: this.username, password: this.password }).then(response => {
|
this.login({ username: this.username, password: this.password })
|
||||||
|
.then(response => {
|
||||||
// Go to dashboard
|
// Go to dashboard
|
||||||
this.loginSuccess()
|
this.loginSuccess()
|
||||||
})
|
})
|
||||||
|
.finally(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.landing = false
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
loginSuccess() {
|
loginSuccess() {
|
||||||
// Cache the user info
|
// Cache the user info
|
||||||
|
|
Loading…
Reference in New Issue