fix: double navigation on login causing 404

This commit is contained in:
enzo
2026-07-22 19:12:06 +08:00
parent c7563ede47
commit 681e4b3a7d
+1 -2
View File
@@ -18,8 +18,7 @@ export default function LoginPage() {
setLoading(true) setLoading(true)
try { try {
await login(username, password) await login(username, password)
toast.success('登录成功') // RedirectIfAuth handles navigation automatically
navigate('/dashboard', { replace: true })
} catch (err: any) { } catch (err: any) {
const status = err?.response?.status const status = err?.response?.status
const detail = err?.response?.data?.detail ?? '登录失败' const detail = err?.response?.data?.detail ?? '登录失败'