账户登录
This commit is contained in:
1 parent
7dea19f2db
commit
55b4f2f9b8
4 files changed
+118
-56
No files matched your search
@@ -17,6 +17,7 @@ import {
|
||||
Plus,
|
||||
Search,
|
||||
Settings,
|
||||
ScrollText,
|
||||
Users,
|
||||
X,
|
||||
} from "lucide-react";
|
||||
@@ -33,11 +34,12 @@ import LoginPage, { type Account } from "./LoginPage";
|
||||
import SettingsPage from "./SettingsPage";
|
||||
import SeoSettingsPage from "./SeoSettingsPage";
|
||||
import NavigationManager from "./NavigationManager";
|
||||
import AgreementSettingsPage from "./AgreementSettingsPage";
|
||||
import { apiPost } from "./api";
|
||||
|
||||
const SITE_WEB = window.location.hostname === "admin.steliro.com" ? "https://site.steliro.com" : "http://localhost:5174";
|
||||
const SITE = "SIT0000000000001";
|
||||
type Section = "products" | "product-categories" | "NEWS" | "NEWS-categories" | "CASE" | "CASE-categories" | "HELP" | "HELP-categories" | "pages" | "navigation" | "seo-settings" | "decoration" | "custom-code" | "media" | "inquiries" | "inquiry-settings" | "settings";
|
||||
type Section = "products" | "product-categories" | "NEWS" | "NEWS-categories" | "CASE" | "CASE-categories" | "HELP" | "HELP-categories" | "pages" | "navigation" | "seo-settings" | "decoration" | "custom-code" | "agreements" | "media" | "inquiries" | "inquiry-settings" | "settings";
|
||||
type EditorialSection = "NEWS" | "CASE" | "HELP";
|
||||
type ContentEditorState = { contentType: EditorialSection; contentCode: string };
|
||||
type Item = {
|
||||
@@ -85,6 +87,7 @@ const frontSiteMenus = [
|
||||
{ key: "decoration" as Section, label: "店铺装修", icon: Paintbrush },
|
||||
{ key: "custom-code" as Section, label: "自定义代码", icon: Code2 },
|
||||
{ key: "seo-settings" as Section, label: "页面 SEO", icon: Search },
|
||||
{ key: "agreements" as Section, label: "协议设置", icon: ScrollText },
|
||||
];
|
||||
const menus = [
|
||||
{ key: "media" as Section, label: "素材中心", icon: Image },
|
||||
@@ -95,6 +98,7 @@ const sectionLabels: Record<Section, string> = {
|
||||
CASE: "案例", "CASE-categories": "案例分类", HELP: "帮助", "HELP-categories": "帮助分类",
|
||||
pages: "页面", navigation: "菜单导航", decoration: "店铺装修", "custom-code": "自定义代码", media: "素材中心", inquiries: "询盘", "inquiry-settings": "询盘设置",
|
||||
"seo-settings": "页面 SEO",
|
||||
agreements: "协议设置",
|
||||
settings: "系统设置",
|
||||
};
|
||||
const statusLabels: Record<string, string> = { DRAFT: "草稿", PUBLISHED: "已上架", OFFLINE: "已下架" };
|
||||
@@ -155,6 +159,8 @@ function App({ account, onAccount, onLogout }: { account: Account; onAccount: (v
|
||||
? { items: [] }
|
||||
: section === "navigation"
|
||||
? { items: [] }
|
||||
: section === "agreements"
|
||||
? { items: [] }
|
||||
: section === "products"
|
||||
? await post("/products/list", { siteCode: SITE })
|
||||
: section === "pages"
|
||||
@@ -351,7 +357,7 @@ function App({ account, onAccount, onLogout }: { account: Account; onAccount: (v
|
||||
</div>
|
||||
</aside>
|
||||
<main>
|
||||
{section === "settings" ? <SettingsPage account={account} onAccount={onAccount} onLogout={onLogout}/> : section === "seo-settings" ? <SeoSettingsPage/> : section === "navigation" ? <NavigationManager/> : section === "decoration" ? <DecorationEditor onBack={() => navigateSection("pages")}/> : section === "custom-code" ? <CustomCodeManager/> : section === "media" ? <MediaCenter/> : editingProduct !== null ? <ProductEditor productCode={editingProduct || undefined} onBack={closeProductEditor} /> : editingContent !== null ? <ContentEditor contentType={editingContent.contentType} contentCode={editingContent.contentCode || undefined} onBack={closeContentEditor} /> : editingPage !== null ? <PageEditor pageCode={editingPage || undefined} onBack={closePageEditor}/> : <>
|
||||
{section === "settings" ? <SettingsPage account={account} onAccount={onAccount} onLogout={onLogout}/> : section === "seo-settings" ? <SeoSettingsPage/> : section === "agreements" ? <AgreementSettingsPage/> : section === "navigation" ? <NavigationManager/> : section === "decoration" ? <DecorationEditor onBack={() => navigateSection("pages")}/> : section === "custom-code" ? <CustomCodeManager/> : section === "media" ? <MediaCenter/> : editingProduct !== null ? <ProductEditor productCode={editingProduct || undefined} onBack={closeProductEditor} /> : editingContent !== null ? <ContentEditor contentType={editingContent.contentType} contentCode={editingContent.contentCode || undefined} onBack={closeContentEditor} /> : editingPage !== null ? <PageEditor pageCode={editingPage || undefined} onBack={closePageEditor}/> : <>
|
||||
{section.endsWith("-categories") ? <CategoryManager contentType={section === "NEWS-categories" ? "NEWS" : section === "CASE-categories" ? "CASE" : section === "HELP-categories" ? "HELP" : undefined}/> : <>
|
||||
<header>
|
||||
<div>
|
||||
|
||||
Reference in new issue
Block a user