From b2abc465cf21c96ac4486a0c9c2313e8d6e18d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=81=9A=E7=A0=81=E5=86=9C?= <599854767@qq.com> Date: Mon, 6 Dec 2021 13:28:12 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=96=B0=E5=A2=9E=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E7=A0=81=E5=BC=80=E5=85=B3=E4=B8=8D=E5=85=BC=E5=AE=B9=E8=80=81?= =?UTF-8?q?=E7=89=88=E6=9C=ACbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ZR.Admin.WebApi/Controllers/System/SysLoginController.cs | 8 +++++--- ZR.Admin.WebApi/ZRAdmin.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs b/ZR.Admin.WebApi/Controllers/System/SysLoginController.cs index 6687616..1e07704 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 30d4241..69d5491 100644 --- a/ZR.Admin.WebApi/ZRAdmin.xml +++ b/ZR.Admin.WebApi/ZRAdmin.xml @@ -70,7 +70,7 @@ - T4代码自动生成 + 文章管理