From 5c844122386aa827be02a2ab61ef4f28ac425afb Mon Sep 17 00:00:00 2001 From: tomoyo233 <44716617+tomoyo233@users.noreply.github.com> Date: Sun, 10 Sep 2023 23:03:14 +0800 Subject: [PATCH] Update sys_user.go (#1540) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 验证码bug修复 --- server/api/v1/system/sys_user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/api/v1/system/sys_user.go b/server/api/v1/system/sys_user.go index 46554e63b..29c0b9079 100644 --- a/server/api/v1/system/sys_user.go +++ b/server/api/v1/system/sys_user.go @@ -49,7 +49,7 @@ func (b *BaseApi) Login(c *gin.Context) { var oc bool = openCaptcha == 0 || openCaptcha < interfaceToInt(v) - if !oc || store.Verify(l.CaptchaId, l.Captcha, true) { + if !oc || (l.CaptchaId != "" && l.Captcha != "" && store.Verify(l.CaptchaId, l.Captcha, true)) { u := &system.SysUser{Username: l.Username, Password: l.Password} user, err := userService.Login(u) if err != nil {