提交 2896895e 作者: 翁进城

增加路由/重写向到/home的判断

上级 16cdcd70
......@@ -3,9 +3,9 @@ import { Navigate, RouteObject } from 'react-router-dom';
import ErrorPage from '~/pages/common/error';
import LayoutView from '~/components/layout';
const Home = React.lazy(() => import('~/pages/home')); //首页
const JobServices = React.lazy(() => import('~/pages/jobServices')); //工作服务
const Mall = React.lazy(() => import('~/pages/mall')); //产品商城
const Home = React.lazy(() => import('~/pages/home')); //首页
const JobServices = React.lazy(() => import('~/pages/jobServices')); //工作服务
const Mall = React.lazy(() => import('~/pages/mall')); //产品商城
interface RouteObjectType {
meta?: {
......@@ -25,11 +25,7 @@ export const routerList: Array<RouteObject & RouteObjectType> = [
},
{
path: '/',
element: (
<LayoutView>
<Navigate to='/home' />
</LayoutView>
),
element: <LayoutView>{location.hash === '#/' && <Navigate to='/home' />}</LayoutView>,
errorElement: <ErrorPage />,
children: [
{
......@@ -41,9 +37,9 @@ export const routerList: Array<RouteObject & RouteObjectType> = [
element: <JobServices />,
},
{
path: 'mall',
element: <Mall />
}
path: '/mall',
element: <Mall />,
},
],
}
},
];
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论