自建登录验证码

This commit is contained in:
biss committed 2026-09-12 08:17:14 +08:00
1 parent 149eb66890
commit 564ffecfed
9 files changed
+75 -49

No files matched your search

+7 -2
View File
@@ -19,7 +19,7 @@ using Jiaowu.Api.Infrastructure.Operations;
using Jiaowu.Api.Infrastructure.Persistence;
using Jiaowu.Api.Infrastructure.Scheduling;
using Jiaowu.Api.Infrastructure.Timetables;
using Lazy.Captcha.Core;
using CaptchaKit.AspNetCore;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authentication.Cookies;
@@ -393,7 +393,12 @@ builder.Services.AddHybridCache(options =>
options.MaximumKeyLength = 512;
options.MaximumPayloadBytes = cacheOptions.MaximumPayloadKilobytes * 1024;
});
builder.Services.AddCaptcha(builder.Configuration);
builder.Services.AddCaptchaKit(options =>
{
options.CodeLength = 5;
options.Lifetime = TimeSpan.FromMinutes(2);
options.CacheKeyPrefix = "jiaowu:login-captcha:";
});
builder.Services.AddSingleton<IAppCache, HybridAppCache>();
builder.Services