refactor: 明确多品牌后台工作区语义

This commit is contained in:
que01 committed 2026-09-23 11:07:57 +08:00
1 parent a8a37c179e
commit 1ea757555d
7 files changed
+87 -4

No files matched your search

+12 -4
View File
@@ -1,6 +1,7 @@
import React, { Suspense, useState } from "react";
import { createRoot } from "react-dom/client";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { useQuery } from "@tanstack/react-query";
import { App, Button, Card, Form, Input, Layout, Menu, Space, Typography, message } from "antd";
import { createApiClient } from "./lib/api.js";
const FeatureInquiriesPage = React.lazy(() =>
@@ -77,10 +78,14 @@ function Login({ onLogin }: { onLogin: () => void }) {
function Dashboard({ onLogout }: { onLogout: () => void }) {
const navigate = useNavigate();
const location = useLocation();
const brand = useQuery({
queryKey: ["admin-shell-brand"],
queryFn: () => createApiClient().getAdminBrand(),
});
const page = location.pathname.split("/")[2] || "overview";
const items = [
{ key: "overview", label: "品牌概览" },
{ key: "brand", label: "品牌表达" },
{ key: "overview", label: "当前品牌概览" },
{ key: "brand", label: "当前品牌表达" },
{ key: "trust", label: "信任内容" },
{ key: "services", label: "业务提供项" },
{ key: "workspace", label: "模板与设置" },
@@ -91,7 +96,7 @@ function Dashboard({ onLogout }: { onLogout: () => void }) {
<Layout style={{ minHeight: "100vh" }}>
<Layout.Sider>
<Typography.Title level={4} style={{ color: "white", padding: 20 }}>
个人品牌
当前品牌工作区
</Typography.Title>
<Menu
theme="dark"
@@ -109,7 +114,10 @@ function Dashboard({ onLogout }: { onLogout: () => void }) {
alignItems: "center",
}}
>
<Space>品牌管理后台</Space>
<Space>
<Typography.Text strong>{brand.data?.name || "当前品牌"}</Typography.Text>
<Typography.Text type="secondary">品牌工作区</Typography.Text>
</Space>
<Button type="text" onClick={onLogout}>
退出登录
</Button>