diff --git a/src/pages/login/index.jsx b/src/pages/login/index.jsx index 60487ac..e475782 100644 --- a/src/pages/login/index.jsx +++ b/src/pages/login/index.jsx @@ -16,7 +16,7 @@ export default function Login() { React.useEffect(() => { const isLogin = localStorage.getItem('token'); - if (isLogin || window.APP_CONFIG.AUTH_ACCESS === '0') { + if (isLogin) { window.location.href = '/'; // 由于是 Vite 多页面,这里使用 window.location.href } }, []); diff --git a/src/routes.tsx b/src/routes.tsx index a4ab27d..162afa5 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -6,7 +6,7 @@ import AuthGuard from './components/AuthGuard'; export const router = createBrowserRouter([ { - path: '/login2', + path: '/login', element: , }, {