From 82a75f760f4c542e38ee3a1eda802ec36d260068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Mon, 17 Jul 2023 16:47:19 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=BC=93=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/index.tsx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/routes/index.tsx b/src/routes/index.tsx index 77a7cc7..14e026f 100644 --- a/src/routes/index.tsx +++ b/src/routes/index.tsx @@ -1,15 +1,18 @@ import { lazy } from "react"; import { RouteObject } from "react-router-dom"; import { system, user } from "../api"; -import { SystemConfigStoreInterface } from "../store/system/systemConfigSlice"; - import { getToken } from "../utils"; +// 页面加载 import { InitPage } from "../pages/init"; -import CoursePage from "../pages/course/index"; -import CoursePlayPage from "../pages/course/video"; -import IndexPage from "../pages/index"; -import LatestLearnPage from "../pages/latest-learn"; import LoginPage from "../pages/login"; +//主页 +const IndexPage = lazy(() => import("../pages/index")); +//课程相关 +const CoursePage = lazy(() => import("../pages/course/index")); +const CoursePlayPage = lazy(() => import("../pages/course/video")); +//最近学习 +const LatestLearnPage = lazy(() => import("../pages/latest-learn")); + import PrivateRoute from "../compenents/private-route"; let RootPage: any = null;