diff --git a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs index a64ec93..587ddc1 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs @@ -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, "验证码错误"); }