Ruoyi是否启用验证码由后台appsettings.json决定

This commit is contained in:
Po
2024-10-14 16:49:33 +08:00
parent 7049175827
commit b59dfbc3fd
4 changed files with 7 additions and 4 deletions

View File

@@ -4,5 +4,7 @@
{
public Guid Uuid { get; set; } = Guid.Empty;
public byte[] Img { get; set; }
public bool IsEnableCaptcha { get; set; }
}
}

View File

@@ -157,7 +157,8 @@ namespace Yi.Framework.Rbac.Application.Services
{
var uuid = _guidGenerator.Create();
var captcha = _captcha.Generate(uuid.ToString());
return new CaptchaImageDto { Img = captcha.Bytes, Uuid = uuid };
var enableCaptcha = _rbacOptions.EnableCaptcha;
return new CaptchaImageDto { Img = captcha.Bytes, Uuid = uuid,IsEnableCaptcha= enableCaptcha };
}
/// <summary>