diff --git a/web/src/app/(main)/layout.tsx b/web/src/app/(main)/layout.tsx
index 71ec3bf..72f995c 100644
--- a/web/src/app/(main)/layout.tsx
+++ b/web/src/app/(main)/layout.tsx
@@ -23,7 +23,6 @@ export default function RootLayout({
-
{children}
diff --git a/web/src/components/common/captcha/turnstile.tsx b/web/src/components/common/captcha/turnstile.tsx
index 72f2a71..aa6cd1e 100644
--- a/web/src/components/common/captcha/turnstile.tsx
+++ b/web/src/components/common/captcha/turnstile.tsx
@@ -25,6 +25,18 @@ function CheckMark() {
);
}
+// 错误的叉
+function ErrorMark() {
+ return (
+
+
+
+ );
+}
+
export function OfficialTurnstileWidget(props: CaptchaProps) {
return
@@ -34,20 +46,26 @@ export function OfficialTurnstileWidget(props: CaptchaProps) {
// 自定义包装组件
export function TurnstileWidget(props: CaptchaProps) {
const t = useTranslations("Captcha");
- const [status, setStatus] = useState<'loading' | 'success'>('loading');
+ const [status, setStatus] = useState<'loading' | 'success' | 'error'>('loading');
// 只在验证通过时才显示勾
const handleSuccess = (token: string) => {
setStatus('success');
props.onSuccess(token);
};
+
+ const handleError = (error: string) => {
+ setStatus('error');
+ props.onError && props.onError(error);
+ };
+
return (
{status === 'loading' &&
}
{status === 'success' &&
}
{status === 'success' ? t("success") :t("doing")}
-
+
);