高级编排分组
This commit is contained in:
@@ -20,6 +20,9 @@ import L2Edit from "./pages/SkillPage/l2Edit";
|
||||
import SystemPage from "./pages/SystemPage";
|
||||
import BuildLayout from "./layout/BuildLayout";
|
||||
import Templates from "./pages/SkillPage/temps";
|
||||
import DiffFlowPage from "./pages/DiffFlowPage";
|
||||
import { ErrorBoundary } from "react-error-boundary";
|
||||
import CrashErrorComponent from "./components/CrashErrorComponent";
|
||||
|
||||
// react 与 react router dom版本不匹配
|
||||
// const FileLibPage = lazy(() => import(/* webpackChunkName: "FileLibPage" */ "./pages/FileLibPage"));
|
||||
@@ -28,6 +31,17 @@ import Templates from "./pages/SkillPage/temps";
|
||||
// const SkillChatPage = lazy(() => import(/* webpackChunkName: "SkillChatPage" */ "./pages/SkillChatPage"));
|
||||
// const FileViewPage = lazy(() => import(/* webpackChunkName: "FileViewPage" */ "./pages/FileViewPage"));
|
||||
|
||||
const ErrorHoc = ({ Comp }) => {
|
||||
return (
|
||||
<ErrorBoundary
|
||||
onReset={() => window.location.href = window.location.href}
|
||||
FallbackComponent={CrashErrorComponent}
|
||||
>
|
||||
<Comp />
|
||||
</ErrorBoundary>
|
||||
);
|
||||
}
|
||||
|
||||
const router = createBrowserRouter([
|
||||
{
|
||||
path: "/",
|
||||
@@ -73,6 +87,7 @@ const router = createBrowserRouter([
|
||||
{ path: "/chat", element: <SkillChatPage /> },
|
||||
{ path: "/chat/:id/", element: <ChatShare /> },
|
||||
{ path: "/report/:id/", element: <Report /> },
|
||||
{ path: "/diff/:id/:vid/:cid", element: <ErrorHoc Comp={DiffFlowPage} /> },
|
||||
// { path: "/test", element: <Test /> },
|
||||
{ path: "*", element: <Navigate to="/" replace /> }
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user