Skip to content

Commit f6c4881

Browse files
authored
Merge pull request #2067 from huiyifyj/fix-captcha-validate-disable-option
Fix captcha validation issue when `OpenCaptcha` option is disabled
2 parents 827d6e6 + e39ad95 commit f6c4881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/api/v1/system/sys_user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (b *BaseApi) Login(c *gin.Context) {
4747
}
4848

4949
var oc bool = openCaptcha == 0 || openCaptcha < interfaceToInt(v)
50-
if oc && !store.Verify(l.CaptchaId, l.Captcha, true) {
50+
if oc && (l.Captcha == "" || l.CaptchaId == "" || !store.Verify(l.CaptchaId, l.Captcha, true)) {
5151
// 验证码次数+1
5252
global.BlackCache.Increment(key, 1)
5353
response.FailWithMessage("验证码错误", c)

0 commit comments

Comments
 (0)