|
|
@@ -170,11 +170,7 @@ func (ct *Login) Login(c *gin.Context) {
|
|
170
|
170
|
|
|
171
|
171
|
// 检查是否需要验证码
|
|
172
|
172
|
if loginLimiter.NeedsCaptcha(clientIp) {
|
|
173
|
|
- if f.Captcha == "" {
|
|
174
|
|
- response.Fail(c, 110, response.TranslateMsg(c, "CaptchaError"))
|
|
175
|
|
- return
|
|
176
|
|
- }
|
|
177
|
|
- if !loginLimiter.VerifyCaptcha(clientIp, f.Captcha) {
|
|
|
173
|
+ if f.Captcha == "" || !loginLimiter.VerifyCaptcha(clientIp, f.Captcha) {
|
|
178
|
174
|
response.Fail(c, 101, response.TranslateMsg(c, "CaptchaError"))
|
|
179
|
175
|
return
|
|
180
|
176
|
}
|