From cfc16940a511454e73a9c3421d0d88799864ac49 Mon Sep 17 00:00:00 2001 From: FatttSnake Date: Thu, 11 May 2023 17:41:56 +0800 Subject: [PATCH] Fixed unable to restore login button state after login failure --- ui/src/pages/Login.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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() } }) }