feat: 删除无用组件
This commit is contained in:
608
src/routes.js
608
src/routes.js
@@ -15,609 +15,13 @@
|
||||
|
||||
*/
|
||||
|
||||
// ⚡ 使用 React.lazy() 实现路由懒加载
|
||||
// 按需加载组件,大幅减少初始 JS 包大小
|
||||
import React from "react";
|
||||
import {
|
||||
CartIcon,
|
||||
DocumentIcon,
|
||||
HomeIcon,
|
||||
PersonIcon,
|
||||
StatsIcon,
|
||||
} from "components/Icons/Icons";
|
||||
|
||||
// ⚡ 懒加载所有页面组件
|
||||
const Calendar = React.lazy(() => import("views/Applications/Calendar"));
|
||||
const DataTables = React.lazy(() => import("views/Applications/DataTables"));
|
||||
const Kanban = React.lazy(() => import("views/Applications/Kanban.js"));
|
||||
const Wizard = React.lazy(() => import("views/Applications/Wizard.js"));
|
||||
const SignInBasic = React.lazy(() => import("views/Authentication/SignIn/SignInBasic.js"));
|
||||
const SignInCover = React.lazy(() => import("views/Authentication/SignIn/SignInCover.js"));
|
||||
const SignInIllustration = React.lazy(() => import("views/Authentication/SignIn/SignInIllustration.js"));
|
||||
const LockBasic = React.lazy(() => import("views/Authentication/Lock/LockBasic.js"));
|
||||
const LockCover = React.lazy(() => import("views/Authentication/Lock/LockCover.js"));
|
||||
const LockIllustration = React.lazy(() => import("views/Authentication/Lock/LockIllustration.js"));
|
||||
const ResetBasic = React.lazy(() => import("views/Authentication/Reset/ResetBasic.js"));
|
||||
const ResetCover = React.lazy(() => import("views/Authentication/Reset/ResetCover.js"));
|
||||
const ResetIllustration = React.lazy(() => import("views/Authentication/Reset/ResetIllustration.js"));
|
||||
const VerificationBasic = React.lazy(() => import("views/Authentication/Verification/VerificationBasic.js"));
|
||||
const VerificationCover = React.lazy(() => import("views/Authentication/Verification/VerificationCover.js"));
|
||||
const VerificationIllustration = React.lazy(() => import("views/Authentication/Verification/VerificationIllustration.js"));
|
||||
const SignUpBasic = React.lazy(() => import("views/Authentication/SignUp/SignUpBasic.js"));
|
||||
const SignUpCover = React.lazy(() => import("views/Authentication/SignUp/SignUpCover.js"));
|
||||
const SignUpIllustration = React.lazy(() => import("views/Authentication/SignUp/SignUpIllustration.js"));
|
||||
const Automotive = React.lazy(() => import("views/Dashboard/Automotive"));
|
||||
const CRM = React.lazy(() => import("views/Dashboard/CRM.js"));
|
||||
const Default = React.lazy(() => import("views/Dashboard/Default.js"));
|
||||
const Landing = React.lazy(() => import("views/Dashboard/Landing.js"));
|
||||
const OrderDetails = React.lazy(() => import("views/Ecommerce/Orders/OrderDetails"));
|
||||
const OrderList = React.lazy(() => import("views/Ecommerce/Orders/OrderList"));
|
||||
const EditProduct = React.lazy(() => import("views/Ecommerce/Products/EditProduct"));
|
||||
const NewProduct = React.lazy(() => import("views/Ecommerce/Products/NewProduct"));
|
||||
const ProductPage = React.lazy(() => import("views/Ecommerce/Products/ProductPage"));
|
||||
const Billing = React.lazy(() => import("views/Pages/Account/Billing.js"));
|
||||
const Subscription = React.lazy(() => import("views/Pages/Account/Subscription.js"));
|
||||
const Invoice = React.lazy(() => import("views/Pages/Account/Invoice.js"));
|
||||
const Settings = React.lazy(() => import("views/Pages/Account/Settings.js"));
|
||||
const Alerts = React.lazy(() => import("views/Pages/Alerts"));
|
||||
const Charts = React.lazy(() => import("views/Pages/Charts.js"));
|
||||
const Pricing = React.lazy(() => import("views/Pages/Pricing.js"));
|
||||
const Overview = React.lazy(() => import("views/Pages/Profile/Overview.js"));
|
||||
const Projects = React.lazy(() => import("views/Pages/Profile/Projects.js"));
|
||||
const Teams = React.lazy(() => import("views/Pages/Profile/Teams.js"));
|
||||
const General = React.lazy(() => import("views/Pages/Projects/General.js"));
|
||||
const Timeline = React.lazy(() => import("views/Pages/Projects/Timeline.js"));
|
||||
const RTLPage = React.lazy(() => import("views/Pages/RTLPage.js"));
|
||||
const NewUser = React.lazy(() => import("views/Pages/Users/NewUser.js"));
|
||||
const Reports = React.lazy(() => import("views/Pages/Users/Reports.js"));
|
||||
const Widgets = React.lazy(() => import("views/Pages/Widgets.js"));
|
||||
const SmartHome = React.lazy(() => import("views/Dashboard/SmartHome"));
|
||||
const ConceptCenter = React.lazy(() => import("views/Concept"));
|
||||
const ProfilePage = React.lazy(() => import("views/Profile/ProfilePage"));
|
||||
const SettingsPage = React.lazy(() => import("views/Settings/SettingsPage"));
|
||||
const LimitAnalyse = React.lazy(() => import("views/LimitAnalyse"));
|
||||
const Community = React.lazy(() => import("views/Community"));
|
||||
const ForecastReport = React.lazy(() => import("views/Company/ForecastReport"));
|
||||
const FinancialPanorama = React.lazy(() => import("views/Company/FinancialPanorama"));
|
||||
const CompanyIndex = React.lazy(() => import("views/Company"));
|
||||
const MarketDataView = React.lazy(() => import("views/Company/MarketDataView"));
|
||||
const StockOverview = React.lazy(() => import("views/StockOverview"));
|
||||
const TradingSimulation = React.lazy(() => import("views/TradingSimulation"));
|
||||
const PrivacyPolicy = React.lazy(() => import("views/Pages/PrivacyPolicy"));
|
||||
const UserAgreement = React.lazy(() => import("views/Pages/UserAgreement"));
|
||||
const WechatCallback = React.lazy(() => import("views/Pages/WechatCallback"));
|
||||
const dashRoutes = [
|
||||
{
|
||||
name: "Dashboard",
|
||||
path: "/dashboard",
|
||||
icon: <HomeIcon color="inherit" />,
|
||||
authIcon: <HomeIcon color="inherit" />,
|
||||
collapse: true,
|
||||
items: [
|
||||
{
|
||||
name: "Landing Page",
|
||||
path: "/dashboard/landing",
|
||||
component: Landing,
|
||||
layout: "/landing",
|
||||
},
|
||||
{
|
||||
name: "Default",
|
||||
path: "/dashboard/default",
|
||||
component: Default,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Automotive",
|
||||
path: "/dashboard/automotive",
|
||||
component: Automotive,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Smart Home",
|
||||
path: "/dashboard/smart-home",
|
||||
component: SmartHome,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "CRM",
|
||||
path: "/dashboard/crm",
|
||||
component: CRM,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "股票分析",
|
||||
path: "/stock-analysis",
|
||||
icon: <StatsIcon color="inherit" />,
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
collapse: true,
|
||||
items: [
|
||||
{
|
||||
name: "股票概览",
|
||||
path: "/stock-analysis/overview",
|
||||
component: StockOverview,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "个股信息",
|
||||
path: "/stock-analysis/company",
|
||||
component: CompanyIndex,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "股票行情",
|
||||
path: "/stock-analysis/market-data",
|
||||
component: MarketDataView,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "涨停分析",
|
||||
path: "/stock-analysis/limit-analyse",
|
||||
component: LimitAnalyse,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "盈利预测报表",
|
||||
path: "/stock-analysis/forecast-report",
|
||||
component: ForecastReport,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "盈利预测报表",
|
||||
path: "/stock-analysis/Financial-report",
|
||||
component: FinancialPanorama,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "概念中心",
|
||||
path: "/concepts",
|
||||
icon: <StatsIcon color="inherit" />, // 或者使用其他图标
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
collapse: false,
|
||||
component: ConceptCenter,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "事件社区",
|
||||
path: "/community",
|
||||
icon: <StatsIcon color="inherit" />,
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
collapse: false,
|
||||
component: Community,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "模拟盘交易",
|
||||
path: "/trading-simulation",
|
||||
icon: <CartIcon color="inherit" />,
|
||||
authIcon: <CartIcon color="inherit" />,
|
||||
collapse: false,
|
||||
component: TradingSimulation,
|
||||
layout: "/home",
|
||||
},
|
||||
{
|
||||
name: "个人资料",
|
||||
path: "/profile",
|
||||
icon: <PersonIcon color="inherit" />,
|
||||
component: ProfilePage,
|
||||
layout: "/admin",
|
||||
invisible: true, // 不在侧边栏显示
|
||||
},
|
||||
{
|
||||
name: "账户设置",
|
||||
path: "/settings",
|
||||
icon: <StatsIcon color="inherit" />,
|
||||
component: SettingsPage,
|
||||
layout: "/admin",
|
||||
invisible: true, // 不在侧边栏显示
|
||||
},
|
||||
{
|
||||
name: "隐私政策",
|
||||
path: "/privacy-policy",
|
||||
icon: <DocumentIcon color="inherit" />,
|
||||
component: PrivacyPolicy,
|
||||
layout: "/home",
|
||||
invisible: true, // 不在侧边栏显示
|
||||
},
|
||||
{
|
||||
name: "用户协议",
|
||||
path: "/user-agreement",
|
||||
icon: <DocumentIcon color="inherit" />,
|
||||
component: UserAgreement,
|
||||
layout: "/home",
|
||||
invisible: true, // 不在侧边栏显示
|
||||
},
|
||||
{
|
||||
name: "微信授权回调",
|
||||
path: "/wechat-callback",
|
||||
icon: <DocumentIcon color="inherit" />,
|
||||
component: WechatCallback,
|
||||
layout: "/home",
|
||||
invisible: true, // 不在侧边栏显示
|
||||
},
|
||||
{
|
||||
name: "PAGES",
|
||||
category: "pages",
|
||||
items: [
|
||||
{
|
||||
name: "Pages",
|
||||
path: "/pages",
|
||||
collapse: true,
|
||||
icon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Profile",
|
||||
path: "/profile",
|
||||
collapse: true,
|
||||
authIcon: <HomeIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Profile Overview",
|
||||
secondaryNavbar: true,
|
||||
path: "/pages/profile/overview",
|
||||
component: Overview,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Teams",
|
||||
secondaryNavbar: true,
|
||||
path: "/pages/profile/teams",
|
||||
component: Teams,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "All Projects",
|
||||
secondaryNavbar: true,
|
||||
path: "/pages/profile/profile-projects",
|
||||
component: Projects,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Users",
|
||||
path: "/users",
|
||||
collapse: true,
|
||||
authIcon: <PersonIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Reports",
|
||||
path: "/pages/users/reports",
|
||||
component: Reports,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "New User",
|
||||
path: "/pages/users/new-user",
|
||||
component: NewUser,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Account",
|
||||
path: "/account",
|
||||
collapse: true,
|
||||
authIcon: <PersonIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Settings",
|
||||
path: "/pages/account/settings",
|
||||
component: Settings,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Billing",
|
||||
component: Billing,
|
||||
path: "/pages/account/billing",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Subscription",
|
||||
component: Subscription,
|
||||
path: "/pages/account/subscription",
|
||||
layout: "/home",
|
||||
},
|
||||
{
|
||||
name: "Invoice",
|
||||
component: Invoice,
|
||||
path: "/pages/account/invoice",
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Projects",
|
||||
path: "/projects",
|
||||
collapse: true,
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "General",
|
||||
path: "/pages/projects/general",
|
||||
component: General,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Timeline",
|
||||
path: "/pages/projects/timeline",
|
||||
component: Timeline,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Pricing Page",
|
||||
component: Pricing,
|
||||
path: "/pages/pricing-page",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "RTL",
|
||||
component: RTLPage,
|
||||
path: "/pages/rtl-support-page",
|
||||
layout: "/rtl",
|
||||
},
|
||||
{
|
||||
name: "Widgets",
|
||||
component: Widgets,
|
||||
path: "/pages/widgets",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Charts",
|
||||
component: Charts,
|
||||
path: "/pages/charts",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Alerts",
|
||||
path: "/pages/alerts",
|
||||
component: Alerts,
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Applications",
|
||||
path: "/applications",
|
||||
icon: <StatsIcon color="inherit" />,
|
||||
collapse: true,
|
||||
items: [
|
||||
{
|
||||
name: "Kanban",
|
||||
component: Kanban,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
path: "/applications/kanban",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Wizard",
|
||||
component: Wizard,
|
||||
authIcon: <CartIcon color="inherit" />,
|
||||
path: "/applications/wizard",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Data Tables",
|
||||
path: "/applications/data-tables",
|
||||
authIcon: <PersonIcon color="inherit" />,
|
||||
component: DataTables,
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Calendar",
|
||||
component: Calendar,
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
path: "/applications/calendar",
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Ecommerce",
|
||||
path: "/ecommerce",
|
||||
icon: <CartIcon color="inherit" />,
|
||||
collapse: true,
|
||||
items: [
|
||||
{
|
||||
name: "Products",
|
||||
path: "/products",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "New Product",
|
||||
component: NewProduct,
|
||||
secondaryNavbar: true,
|
||||
path: "/ecommerce/products/new-product",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Edit Product",
|
||||
component: EditProduct,
|
||||
path: "/ecommerce/products/edit-product",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Product Page",
|
||||
component: ProductPage,
|
||||
path: "/ecommerce/products/product-page",
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Orders",
|
||||
path: "/orders",
|
||||
collapse: true,
|
||||
authIcon: <StatsIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Order List",
|
||||
component: OrderList,
|
||||
path: "/ecommerce/orders/order-list",
|
||||
layout: "/admin",
|
||||
},
|
||||
{
|
||||
name: "Order Details",
|
||||
component: OrderDetails,
|
||||
path: "/ecommerce/orders/order-details",
|
||||
layout: "/admin",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Authentication",
|
||||
path: "/authentication",
|
||||
icon: <PersonIcon color="inherit" />,
|
||||
collapse: true,
|
||||
items: [
|
||||
{
|
||||
name: "Sign In",
|
||||
path: "/authentication/sign-in",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Basic",
|
||||
component: SignInBasic,
|
||||
path: "/authentication/sign-in/basic",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Cover",
|
||||
component: SignInCover,
|
||||
path: "/authentication/sign-in/cover",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Illustration",
|
||||
component: SignInIllustration,
|
||||
secondaryNavbar: true,
|
||||
path: "/authentication/sign-in/illustration",
|
||||
layout: "/auth",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Sign Up",
|
||||
path: "/authentication/sign-up",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Basic",
|
||||
component: SignUpBasic,
|
||||
path: "/authentication/sign-up/basic",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Cover",
|
||||
component: SignUpCover,
|
||||
path: "/authentication/sign-up/cover",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Illustration",
|
||||
secondaryNavbar: true,
|
||||
component: SignUpIllustration,
|
||||
path: "/authentication/sign-up/illustration",
|
||||
layout: "/auth",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Reset password",
|
||||
path: "/authentication/reset",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Basic",
|
||||
component: ResetBasic,
|
||||
path: "/authentication/reset/basic",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Cover",
|
||||
component: ResetCover,
|
||||
path: "/authentication/reset/cover",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Illustration",
|
||||
secondaryNavbar: true,
|
||||
component: ResetIllustration,
|
||||
path: "/authentication/reset/illustration",
|
||||
layout: "/auth",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Lock",
|
||||
path: "/authentication/lock",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Basic",
|
||||
component: LockBasic,
|
||||
path: "/authentication/lock/basic",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Cover",
|
||||
component: LockCover,
|
||||
path: "/authentication/lock/cover",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Illustration",
|
||||
secondaryNavbar: true,
|
||||
component: LockIllustration,
|
||||
path: "/authentication/lock/illustration",
|
||||
layout: "/auth",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "2-Step Verification",
|
||||
path: "/authentication/verification",
|
||||
collapse: true,
|
||||
authIcon: <DocumentIcon color="inherit" />,
|
||||
items: [
|
||||
{
|
||||
name: "Basic",
|
||||
component: VerificationBasic,
|
||||
path: "/authentication/verification/basic",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Cover",
|
||||
component: VerificationCover,
|
||||
path: "/authentication/verification/cover",
|
||||
layout: "/auth",
|
||||
},
|
||||
{
|
||||
name: "Illustration",
|
||||
secondaryNavbar: true,
|
||||
component: VerificationIllustration,
|
||||
path: "/authentication/verification/illustration",
|
||||
layout: "/auth",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
// ⚠️ Admin 布局已移除
|
||||
// 实际路由配置现在在 /src/App.js 中
|
||||
// 此文件保留仅为兼容可能的旧引用
|
||||
|
||||
// 导出空数组以保持向后兼容
|
||||
const dashRoutes = [];
|
||||
|
||||
export default dashRoutes;
|
||||
|
||||
Reference in New Issue
Block a user