feat: 重构后台品牌工作台基础骨架

This commit is contained in:
que01 committed 2026-09-20 16:41:57 +08:00
1 parent ac4abc1305
commit e402ba58d9
4 files changed
+209 -5

No files matched your search

+12 -5
View File
@@ -49,6 +49,11 @@ const FeatureWorkspacePage = React.lazy(() =>
default: module.WorkspacePage,
})),
);
const FeatureOverviewPage = React.lazy(() =>
import("./features/overview/OverviewPage.js").then((module) => ({
default: module.OverviewPage,
})),
);
import { BrowserRouter, Navigate, Route, Routes, useLocation, useNavigate } from "react-router-dom";
import type {
BrandProfile,
@@ -96,12 +101,13 @@ function Login({ onLogin }: { onLogin: () => void }) {
function Dashboard({ onLogout }: { onLogout: () => void }) {
const navigate = useNavigate();
const location = useLocation();
const page = location.pathname.split("/")[2] || "brand";
const page = location.pathname.split("/")[2] || "overview";
const items = [
{ key: "brand", label: "品牌信任" },
{ key: "workspace", label: "工作空间" },
{ key: "overview", label: "品牌概览" },
{ key: "brand", label: "品牌表达" },
{ key: "trust", label: "信任内容" },
{ key: "services", label: "服务与合作" },
{ key: "services", label: "业务提供项" },
{ key: "workspace", label: "模板与设置" },
{ key: "inquiries", label: "咨询记录" },
];
return (
@@ -134,12 +140,13 @@ function Dashboard({ onLogout }: { onLogout: () => void }) {
<Layout.Content style={{ padding: 24 }}>
<Suspense fallback={<Card loading />}>
<Routes>
<Route path="/admin/overview" element={<FeatureOverviewPage />} />
<Route path="/admin/brand" element={<FeatureBrandPage />} />
<Route path="/admin/workspace" element={<FeatureWorkspacePage />} />
<Route path="/admin/trust" element={<FeatureTrustContentPage />} />
<Route path="/admin/services" element={<FeatureServicesPage />} />
<Route path="/admin/inquiries" element={<FeatureInquiriesPage />} />
<Route path="*" element={<Navigate to="/admin/brand" replace />} />
<Route path="*" element={<Navigate to="/admin/overview" replace />} />
</Routes>
</Suspense>
</Layout.Content>