diff --git a/software/web/src/App.tsx b/software/web/src/App.tsx index 73c1ea8..259db39 100644 --- a/software/web/src/App.tsx +++ b/software/web/src/App.tsx @@ -31,7 +31,7 @@ function RequireAuth({ children }: { children: React.ReactNode }) { return null; // 等待恢复完成 } if (!isAuthenticated) { - return ; + return ; } return <>{children}; } @@ -40,7 +40,7 @@ function RequireAuth({ children }: { children: React.ReactNode }) { function RedirectIfAuth({ children }: { children: React.ReactNode }) { const { isAuthenticated } = useAuthStore(); if (isAuthenticated) { - return ; + return ; } return <>{children}; } @@ -86,7 +86,7 @@ export default function App() { {/* 默认重定向到 Dashboard */} - } /> + } /> ); diff --git a/software/web/src/layouts/AdminLayout.tsx b/software/web/src/layouts/AdminLayout.tsx index 6883816..7c4fee9 100644 --- a/software/web/src/layouts/AdminLayout.tsx +++ b/software/web/src/layouts/AdminLayout.tsx @@ -81,7 +81,7 @@ export default function AdminLayout() { const handleLogout = () => { logout(); - navigate('/login'); + navigate('login'); }; const dropList = ( diff --git a/software/web/src/pages/Login.tsx b/software/web/src/pages/Login.tsx index 5490025..21b18f4 100644 --- a/software/web/src/pages/Login.tsx +++ b/software/web/src/pages/Login.tsx @@ -16,7 +16,7 @@ export default function Login() { try { await login(values); Message.success('登录成功'); - navigate('/dashboard', { replace: true }); + navigate('dashboard', { replace: true }); } catch { Message.error('手机号或密码错误'); } finally { diff --git a/software/web/src/pages/devices/cabinet.tsx b/software/web/src/pages/devices/cabinet.tsx index 68ff9e7..402b386 100644 --- a/software/web/src/pages/devices/cabinet.tsx +++ b/software/web/src/pages/devices/cabinet.tsx @@ -138,7 +138,7 @@ export default function CabinetDetail() {