Update sys_user.go (#1540)

验证码bug修复
This commit is contained in:
tomoyo233
2023-09-10 23:03:14 +08:00
committed by GitHub
parent 13112aa4d8
commit 5c84412238

View File

@@ -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 {