diff --git a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs index 66876160..1e077041 100644 --- a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs +++ b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs @@ -143,17 +143,19 @@ namespace ZR.Admin.WebApi.Controllers.System string uuid = Guid.NewGuid().ToString().Replace("-", ""); SysConfig sysConfig = sysConfigService.GetSysConfigByKey("sys.account.captchaOnOff"); + var captchaOff = sysConfig?.ConfigValue ?? "0"; + var code = SecurityCodeHelper.GetRandomEnDigitalText(4); byte[] imgByte; - if (sysConfig.ConfigValue == "1") + if (captchaOff == "1") { imgByte = SecurityCodeHelper.GetGifEnDigitalCodeByte(code);//动态gif数字字母 } - else if (sysConfig.ConfigValue == "2") + else if (captchaOff == "2") { imgByte = SecurityCodeHelper.GetGifBubbleCodeByte(code);//动态gif泡泡 } - else if (sysConfig.ConfigValue == "3") + else if (captchaOff == "3") { imgByte = SecurityCodeHelper.GetBubbleCodeByte(code);//泡泡 } diff --git a/ZR.Admin.WebApi/ZRAdmin.xml b/ZR.Admin.WebApi/ZRAdmin.xml index 30d42410..69d5491d 100644 --- a/ZR.Admin.WebApi/ZRAdmin.xml +++ b/ZR.Admin.WebApi/ZRAdmin.xml @@ -70,7 +70,7 @@ - T4代码自动生成 + 文章管理