fix(frontend): fix blank page after logout and login page branding

This commit is contained in:
sagitchu
2026-04-21 09:33:04 +08:00
parent b382caa347
commit f6d2ab3270
2 changed files with 6 additions and 15 deletions
+3 -11
View File
@@ -1,4 +1,4 @@
import { Route, Routes, useLocation, useNavigate } from "react-router-dom";
import { Route, Routes, useLocation, useNavigate, Navigate } from "react-router-dom";
import { useEffect } from "react";
import { AnimatePresence } from "framer-motion";
@@ -44,11 +44,7 @@ const ProtectedRoute = ({
}, [authenticated, navigate]);
if (!authenticated) {
return (
<div className="flex items-center justify-center min-h-screen bg-mesh-gradient">
<div className="text-lg text-gray-700 dark:text-gray-200" />
</div>
);
return <Navigate replace to="/" />;
}
// 如果跳过布局,直接返回子组件
@@ -76,11 +72,7 @@ const LoginRoute = () => {
}, [authenticated, navigate]);
if (authenticated) {
return (
<div className="flex items-center justify-center min-h-screen bg-mesh-gradient">
<div className="text-lg text-gray-700 dark:text-gray-200" />
</div>
);
return <Navigate replace to="/dashboard" />;
}
return <IndexPage />;