fix:登录注册验证码校验错误

This commit is contained in:
不做码农 2023-03-21 11:13:12 +08:00
parent 0b3cf9e0b8
commit 00beb9890c

View File

@ -73,7 +73,7 @@ namespace ZR.Admin.WebApi.Controllers.System
if (loginBody == null) { throw new CustomException("请求参数错误"); }
loginBody.LoginIP = HttpContextExtension.GetClientUserIp(HttpContext);
SysConfig sysConfig = sysConfigService.GetSysConfigByKey("sys.account.captchaOnOff");
if (sysConfig?.ConfigValue != "off" && SecurityCodeHelper.Validate(loginBody.Uuid, loginBody.Code))
if (sysConfig?.ConfigValue != "off" && !SecurityCodeHelper.Validate(loginBody.Uuid, loginBody.Code))
{
return ToResponse(ResultCode.CAPTCHA_ERROR, "验证码错误");
}
@ -198,7 +198,7 @@ namespace ZR.Admin.WebApi.Controllers.System
return ToResponse(ResultCode.CUSTOM_ERROR, "当前系统没有开启注册功能!");
}
SysConfig sysConfig = sysConfigService.GetSysConfigByKey("sys.account.captchaOnOff");
if (sysConfig?.ConfigValue != "off" && SecurityCodeHelper.Validate(dto.Uuid, dto.Code))
if (sysConfig?.ConfigValue != "off" && !SecurityCodeHelper.Validate(dto.Uuid, dto.Code))
{
return ToResponse(ResultCode.CAPTCHA_ERROR, "验证码错误");
}