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)
try {
await login(username, password)
toast.success('登录成功')
navigate('/dashboard', { replace: true })
// RedirectIfAuth handles navigation automatically
} catch (err: any) {
const status = err?.response?.status
const detail = err?.response?.data?.detail ?? '登录失败'