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>

View File

@ -47,6 +47,7 @@
},
"Login": {
"captcha_error": "验证错误,请重试。",
"logging": "正在登录...",
"welcome": "欢迎回来",
"with_oidc": "使用第三方身份提供者",
"or_continue_with_local_account": "或使用用户名和密码",