fix: nested route navigation — use relative paths, redirect to / not /dashboard

This commit is contained in:
enzo
2026-07-22 19:17:30 +08:00
parent 681e4b3a7d
commit 07ff8c2a12
+2 -2
View File
@@ -43,7 +43,7 @@ function RedirectIfAuth({ children }: { children: ReactNode }) {
const { isAuthenticated } = useAuth()
if (isAuthenticated) {
return <Navigate to="/dashboard" replace />
return <Navigate to="/" replace />
}
return <>{children}</>
}
@@ -143,7 +143,7 @@ function AppRoutes() {
<AppLayout onSearch={handleSearch} onSearchNavigate={handleSearchNavigate}>
<Suspense fallback={<Loading />}>
<Routes>
<Route index element={<Navigate to="/dashboard" replace />} />
<Route index element={<Navigate to="dashboard" replace />} />
<Route path="dashboard" element={<DashboardPage />} />
<Route path="gateway" element={<GatewayPage />} />
<Route path="health" element={<HealthPage />} />