mirror of
https://github.com/nsnail/NetAdmin.git
synced 2025-12-29 00:55:48 +08:00
wip: 🧠 初步的框架
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using NetAdmin.Domain.Dto.Sys.Captcha;
|
||||
using NetAdmin.Host.Controllers;
|
||||
using NetAdmin.SysComponent.Application.Modules.Sys;
|
||||
using NetAdmin.SysComponent.Application.Services.Sys.Dependency;
|
||||
using NetAdmin.SysComponent.Cache.Sys.Dependency;
|
||||
|
||||
namespace NetAdmin.SysComponent.Host.Controllers.Sys;
|
||||
|
||||
/// <summary>
|
||||
/// 人机验证服务
|
||||
/// </summary>
|
||||
[ApiDescriptionSettings(nameof(Sys), Module = nameof(Sys))]
|
||||
public sealed class CaptchaController : ControllerBase<ICaptchaCache, ICaptchaService>, ICaptchaModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CaptchaController" /> class.
|
||||
/// </summary>
|
||||
public CaptchaController(ICaptchaCache cache) //
|
||||
: base(cache) { }
|
||||
|
||||
/// <summary>
|
||||
/// 获取人机校验图
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
public Task<GetCaptchaRsp> GetCaptchaImageAsync()
|
||||
{
|
||||
return Cache.GetCaptchaImageAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 完成人机校验
|
||||
/// </summary>
|
||||
[AllowAnonymous]
|
||||
public Task<bool> VerifyCaptchaAsync(VerifyCaptchaReq req)
|
||||
{
|
||||
return Cache.VerifyCaptchaAsync(req);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user