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 })
-