feat: 添加登录状态提示,优化用户登录体验

This commit is contained in:
2025-09-10 21:51:12 +08:00
parent 8b7b9987ed
commit 8a018a3c55
2 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,7 @@ export function LoginForm({
} | null>(null)
const [captchaToken, setCaptchaToken] = useState<string | null>(null)
const [captchaError, setCaptchaError] = useState<string | null>(null)
const [isLogging, setIsLogging] = useState(false)
const [refreshCaptchaKey, setRefreshCaptchaKey] = useState(0)
const [{ username, password }, setCredentials] = useState({ username: '', password: '' })
const router = useRouter()
@ -164,9 +165,9 @@ export function LoginForm({
type="submit"
className="w-full"
onClick={handleLogin}
disabled={!captchaToken}
disabled={!captchaToken || isLogging}
>
{t("login")}
{isLogging ? t("logging") : t("login")}
</Button>
</div>