diff --git a/app/globals.css b/app/globals.css index a088d04..24d68b2 100644 --- a/app/globals.css +++ b/app/globals.css @@ -2800,32 +2800,6 @@ button:active:not(:disabled), margin-bottom: 0; } -.auth-captcha-row { - display: grid; - grid-template-columns: minmax(0, 1fr) 118px; - gap: 8px; - align-items: center; -} - -.auth-captcha-button { - height: 44px; - border: 1px solid var(--line); - border-radius: 8px; - background: #ffffff; - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0; - overflow: hidden; -} - -.auth-captcha-button img { - width: 100%; - height: 100%; - display: block; - object-fit: cover; -} - .auth-submit, .auth-submit.button { width: 100%; @@ -2899,8 +2873,4 @@ button:active:not(:disabled), width: 34px; min-height: 34px; } - - .auth-captcha-row { - grid-template-columns: minmax(0, 1fr) 104px; - } } diff --git a/components/auth-login-panel.tsx b/components/auth-login-panel.tsx index 9cedf39..1013c5b 100644 --- a/components/auth-login-panel.tsx +++ b/components/auth-login-panel.tsx @@ -1,9 +1,9 @@ "use client"; -import { useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useRef, useState } from "react"; import type { FormEvent } from "react"; import Image from "next/image"; -import { Loader2, LogIn, RefreshCw } from "lucide-react"; +import { Loader2, LogIn } from "lucide-react"; import { pulseFeedback, revealChildren, runScopedMotion } from "@/lib/ui/motion"; export function AuthLoginPanel({ @@ -19,8 +19,6 @@ export function AuthLoginPanel({ }) { const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); - const [code, setCode] = useState(""); - const [randomStr, setRandomStr] = useState(""); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(null); const screenRef = useRef(null); @@ -35,16 +33,6 @@ export function AuthLoginPanel({ pulseFeedback(feedbackRef.current); }, [error, message, missing?.join(",")]); - const captchaSrc = useMemo(() => { - if (!randomStr) return ""; - return `/api/auth/captcha?randomStr=${encodeURIComponent(randomStr)}`; - }, [randomStr]); - - function refreshCaptcha() { - setCode(""); - setRandomStr(crypto.randomUUID()); - } - async function submit(event: FormEvent) { event.preventDefault(); if (!configured || submitting) return; @@ -52,10 +40,6 @@ export function AuthLoginPanel({ setError(null); try { const payload: Record = { username, password, next }; - if (code.trim() && randomStr) { - payload.code = code.trim(); - payload.randomStr = randomStr; - } const response = await fetch("/api/auth/password", { method: "POST", headers: { "Content-Type": "application/json" }, @@ -66,7 +50,6 @@ export function AuthLoginPanel({ window.location.assign(result.redirectTo || next || "/create"); } catch (err) { setError(err instanceof Error ? err.message : String(err)); - refreshCaptcha(); } finally { setSubmitting(false); } @@ -116,29 +99,6 @@ export function AuthLoginPanel({ placeholder="请输入密码" /> - -