mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-26 19:16:24 +00:00
feat: 添加登录状态提示,优化用户登录体验
This commit is contained in:
@ -34,6 +34,7 @@ export function LoginForm({
|
|||||||
} | null>(null)
|
} | null>(null)
|
||||||
const [captchaToken, setCaptchaToken] = useState<string | null>(null)
|
const [captchaToken, setCaptchaToken] = useState<string | null>(null)
|
||||||
const [captchaError, setCaptchaError] = useState<string | null>(null)
|
const [captchaError, setCaptchaError] = useState<string | null>(null)
|
||||||
|
const [isLogging, setIsLogging] = useState(false)
|
||||||
const [refreshCaptchaKey, setRefreshCaptchaKey] = useState(0)
|
const [refreshCaptchaKey, setRefreshCaptchaKey] = useState(0)
|
||||||
const [{ username, password }, setCredentials] = useState({ username: '', password: '' })
|
const [{ username, password }, setCredentials] = useState({ username: '', password: '' })
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -164,9 +165,9 @@ export function LoginForm({
|
|||||||
type="submit"
|
type="submit"
|
||||||
className="w-full"
|
className="w-full"
|
||||||
onClick={handleLogin}
|
onClick={handleLogin}
|
||||||
disabled={!captchaToken}
|
disabled={!captchaToken || isLogging}
|
||||||
>
|
>
|
||||||
{t("login")}
|
{isLogging ? t("logging") : t("login")}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
},
|
},
|
||||||
"Login": {
|
"Login": {
|
||||||
"captcha_error": "验证错误,请重试。",
|
"captcha_error": "验证错误,请重试。",
|
||||||
|
"logging": "正在登录...",
|
||||||
"welcome": "欢迎回来",
|
"welcome": "欢迎回来",
|
||||||
"with_oidc": "使用第三方身份提供者",
|
"with_oidc": "使用第三方身份提供者",
|
||||||
"or_continue_with_local_account": "或使用用户名和密码",
|
"or_continue_with_local_account": "或使用用户名和密码",
|
||||||
|
Reference in New Issue
Block a user