From df87aa16d3c2f8f75c43478444dcf40a9e0e3cdd Mon Sep 17 00:00:00 2001 From: biss Date: Sat, 12 Sep 2026 10:11:11 +0800 Subject: [PATCH] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Jiaowu.Api/Controllers/AuthController.cs | 2 +- tests/Jiaowu.Api.Tests/CaptchaKitIntegrationTests.cs | 2 +- web/src/components/LoginCaptcha.vue | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Jiaowu.Api/Controllers/AuthController.cs b/src/Jiaowu.Api/Controllers/AuthController.cs index 189e420..c17d1f4 100644 --- a/src/Jiaowu.Api/Controllers/AuthController.cs +++ b/src/Jiaowu.Api/Controllers/AuthController.cs @@ -335,7 +335,7 @@ public sealed record LoginRequest( [Required, MaxLength(100)] string UserName, [Required, MaxLength(100)] string Password, [Required, MinLength(16), MaxLength(64)] string CaptchaId, - [Required, MinLength(3), MaxLength(16)] string CaptchaCode, + [Required, MinLength(1), MaxLength(16)] string CaptchaCode, bool IsNativeApp = false); public sealed record LoginCaptchaResponse( diff --git a/tests/Jiaowu.Api.Tests/CaptchaKitIntegrationTests.cs b/tests/Jiaowu.Api.Tests/CaptchaKitIntegrationTests.cs index ec1ec32..a4abe92 100644 --- a/tests/Jiaowu.Api.Tests/CaptchaKitIntegrationTests.cs +++ b/tests/Jiaowu.Api.Tests/CaptchaKitIntegrationTests.cs @@ -50,7 +50,7 @@ public sealed class CaptchaKitIntegrationTests Assert.Contains(CaptchaChallengeType.TextImage, types); Assert.Contains(CaptchaChallengeType.Selection, types); - Assert.Contains(CaptchaChallengeType.OneClick, types); + Assert.Contains(CaptchaChallengeType.MathImage, types); } private sealed class KnownGenerator : ICaptchaGenerator diff --git a/web/src/components/LoginCaptcha.vue b/web/src/components/LoginCaptcha.vue index 0fdf822..0246871 100644 --- a/web/src/components/LoginCaptcha.vue +++ b/web/src/components/LoginCaptcha.vue @@ -9,7 +9,7 @@ interface CaptchaChoice { interface CaptchaChallenge { captchaId: string - type: 'TextImage' | 'Selection' | 'OneClick' + type: 'TextImage' | 'MathImage' | 'Selection' | 'OneClick' prompt?: string choices?: CaptchaChoice[] imageData?: string @@ -46,12 +46,13 @@ defineExpose({ refresh })
-