diff --git a/ui/src/pages/Login.vue b/ui/src/pages/Login.vue
index e7aa071..aae61b0 100644
--- a/ui/src/pages/Login.vue
+++ b/ui/src/pages/Login.vue
@@ -102,6 +102,10 @@ export default {
getNewCaptcha() {
this.captchaSrc = getCaptchaSrc()
},
+ resetLogin() {
+ this.getNewCaptcha()
+ this.loggingIn = false
+ },
login() {
if (this.loggingIn) {
return
@@ -114,6 +118,7 @@ export default {
dangerouslyUseHTMLString: true,
message: '用户名 为空'
})
+ this.loggingIn = false
return
}
if (!this.password) {
@@ -121,6 +126,7 @@ export default {
dangerouslyUseHTMLString: true,
message: '密码 为空'
})
+ this.loggingIn = false
return
}
if (!this.captcha) {
@@ -128,6 +134,7 @@ export default {
dangerouslyUseHTMLString: true,
message: '验证码 为空'
})
+ this.loggingIn = false
return
}
if (!verifyCaptcha(this.captcha)) {
@@ -135,6 +142,7 @@ export default {
dangerouslyUseHTMLString: true,
message: '验证码 错误'
})
+ this.loggingIn = false
return
}
login(this.userName, this.password).then((res) => {
@@ -153,8 +161,7 @@ export default {
dangerouslyUseHTMLString: true,
message: '用户名 或 密码 错误'
})
- this.getNewCaptcha()
- this.loggingIn = false
+ this.resetLogin()
}
})
}