diff --git a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs index e6d88804d8606f30dd69cad2da1e1fd216381c3c..f5a0fa04185e01e593c74fd334012c88d85324f8 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs @@ -1,4 +1,4 @@ -using Lazy.Captcha.Core; +using Lazy.Captcha.Core; using Microsoft.AspNetCore.Mvc; using ZR.Admin.WebApi.Filters; using ZR.Infrastructure.Helper; @@ -141,9 +141,9 @@ namespace ZR.Admin.WebApi.Controllers.System SysConfig sysConfig = sysConfigService.GetSysConfigByKey("sys.account.captchaOnOff"); var captchaOff = sysConfig?.ConfigValue ?? "0"; - var info = SecurityCodeHelper.Generate(uuid, 60); - var obj = new { captchaOff, uuid, img = info.Base64 };// File(stream, "image/png") - + CaptchaData? info = null; + if(captchaOff == "0") info = SecurityCodeHelper.Generate(uuid, 60); + var obj = new { captchaOff, uuid, img = info?.Base64 };// File(stream, "image/png") return SUCCESS(obj); }