From 2b047b3d1886a3cf4f83b6b29fcdfc4c521cd270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Fri, 6 Mar 2026 21:07:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YD_Event.Web.Core/Startup.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/YD_Event.Web.Core/Startup.cs b/YD_Event.Web.Core/Startup.cs index 1e3b731..1a14fee 100644 --- a/YD_Event.Web.Core/Startup.cs +++ b/YD_Event.Web.Core/Startup.cs @@ -154,7 +154,7 @@ public class Startup : AppStartup option.CodeLength = 4; // 验证码长度, 要放在CaptchaType设置后. 当类型为算术表达式时,长度代表操作的个数 option.ExpirySeconds = 60; // 验证码过期时间 option.IgnoreCase = true; // 比较时是否忽略大小写 - option.StoreageKeyPrefix = ""; // 存储键前缀 + option.StorageKeyPrefix = ""; // 存储键前缀 option.ImageOption.Animation = true; // 是否启用动画 option.ImageOption.FrameDelay = 300; // 每帧延迟,Animation=true时有效, 默认30 @@ -171,8 +171,9 @@ public class Startup : AppStartup option.ImageOption.InterferenceLineCount = 2; // 干扰线数量 option.ImageOption.FontSize = 36; // 字体大小 - //option.ImageOption.FontFamily = DefaultFontFamilys.Instance.Actionj; // 字体 - + // 使用系统安装的中文字体,避免使用 Lazy.Captcha.Core 内置字体(可能不兼容 Linux) + option.ImageOption.FontFamily = DefaultFontFamilies.Instance.Kaiti; + /* * 中文使用kaiti,其他字符可根据喜好设置(可能部分转字符会出现绘制不出的情况)。 * 当验证码类型为“ARITHMETIC”时,不要使用“Ransom”字体。(运算符和等号绘制不出来)