From e36d307d28766dab228fb0875cd1fbc870c2f62a Mon Sep 17 00:00:00 2001 From: lejianwen <84855512@qq.com> Date: Wed, 18 Dec 2024 13:51:06 +0800 Subject: [PATCH] fix captcha --- http/controller/admin/login.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/http/controller/admin/login.go b/http/controller/admin/login.go index b770db2..f18f348 100644 --- a/http/controller/admin/login.go +++ b/http/controller/admin/login.go @@ -170,11 +170,7 @@ func (ct *Login) Login(c *gin.Context) { // 检查是否需要验证码 if loginLimiter.NeedsCaptcha(clientIp) { - if f.Captcha == "" { - response.Fail(c, 110, response.TranslateMsg(c, "CaptchaError")) - return - } - if !loginLimiter.VerifyCaptcha(clientIp, f.Captcha) { + if f.Captcha == "" || !loginLimiter.VerifyCaptcha(clientIp, f.Captcha) { response.Fail(c, 101, response.TranslateMsg(c, "CaptchaError")) return }