账户登录
This commit is contained in:
1 parent
8e80e26c91
commit
833161e34c
84 files changed
+814
-142
No files matched your search
@@ -29,11 +29,12 @@ import CustomCodeManager from "./CustomCodeManager";
|
||||
import MediaCenter from "./MediaCenter";
|
||||
import LoginPage, { type Account } from "./LoginPage";
|
||||
import SettingsPage from "./SettingsPage";
|
||||
import SeoSettingsPage from "./SeoSettingsPage";
|
||||
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" | "decoration" | "custom-code" | "media" | "inquiries" | "inquiry-settings" | "settings";
|
||||
type Section = "products" | "product-categories" | "NEWS" | "NEWS-categories" | "CASE" | "CASE-categories" | "HELP" | "HELP-categories" | "pages" | "seo-settings" | "decoration" | "custom-code" | "media" | "inquiries" | "inquiry-settings" | "settings";
|
||||
type EditorialSection = "NEWS" | "CASE" | "HELP";
|
||||
type ContentEditorState = { contentType: EditorialSection; contentCode: string };
|
||||
type Item = {
|
||||
@@ -86,6 +87,7 @@ const sectionLabels: Record<Section, string> = {
|
||||
products: "产品", "product-categories": "产品分类", NEWS: "新闻", "NEWS-categories": "新闻分类",
|
||||
CASE: "案例", "CASE-categories": "案例分类", HELP: "帮助", "HELP-categories": "帮助分类",
|
||||
pages: "页面", decoration: "店铺装修", "custom-code": "自定义代码", media: "素材中心", inquiries: "询盘", "inquiry-settings": "询盘设置",
|
||||
"seo-settings": "页面 SEO",
|
||||
settings: "系统设置",
|
||||
};
|
||||
const statusLabels: Record<string, string> = { DRAFT: "草稿", PUBLISHED: "已上架", OFFLINE: "已下架" };
|
||||
@@ -318,6 +320,7 @@ function App({ account, onAccount, onLogout }: { account: Account; onAccount: (v
|
||||
{m.label}
|
||||
</button>
|
||||
))}
|
||||
<button className={section === "seo-settings" ? "active" : ""} onClick={() => navigateSection("seo-settings")}><Search size={18}/>页面 SEO</button>
|
||||
</nav>
|
||||
<div className="aside-bottom">
|
||||
<button>
|
||||
@@ -335,7 +338,7 @@ function App({ account, onAccount, onLogout }: { account: Account; onAccount: (v
|
||||
</div>
|
||||
</aside>
|
||||
<main>
|
||||
{section === "settings" ? <SettingsPage account={account} onAccount={onAccount} onLogout={onLogout}/> : 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 === "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