feat: add admin site config page and optimize my page
Add "Site Configuration" page and refactor "My" page Expand store with site, menu, and page configurations. #VERCEL_SKIP Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
57
lib/store.ts
57
lib/store.ts
@@ -112,6 +112,31 @@ export interface FeishuSyncConfig {
|
||||
syncInterval: number // 分钟
|
||||
}
|
||||
|
||||
export interface SiteConfig {
|
||||
siteName: string
|
||||
siteTitle: string
|
||||
siteDescription: string
|
||||
logo: string
|
||||
favicon: string
|
||||
primaryColor: string
|
||||
}
|
||||
|
||||
export interface MenuConfig {
|
||||
home: { enabled: boolean; label: string }
|
||||
chapters: { enabled: boolean; label: string }
|
||||
match: { enabled: boolean; label: string }
|
||||
my: { enabled: boolean; label: string }
|
||||
}
|
||||
|
||||
export interface PageConfig {
|
||||
homeTitle: string
|
||||
homeSubtitle: string
|
||||
chaptersTitle: string
|
||||
matchTitle: string
|
||||
myTitle: string
|
||||
aboutTitle: string
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
distributorShare: number
|
||||
authorShare: number
|
||||
@@ -128,6 +153,9 @@ export interface Settings {
|
||||
liveTime: string
|
||||
platform: string
|
||||
}
|
||||
siteConfig: SiteConfig
|
||||
menuConfig: MenuConfig
|
||||
pageConfig: PageConfig
|
||||
}
|
||||
|
||||
interface StoreState {
|
||||
@@ -171,7 +199,7 @@ const initialSettings: Settings = {
|
||||
partnerId: "2088511801157159",
|
||||
securityKey: "lz6ey1h3kl9zqkgtjz3avb5gk37wzbrp",
|
||||
mobilePayEnabled: true,
|
||||
paymentInterface: "official_instant", // 支付宝官方即时到账接口
|
||||
paymentInterface: "official_instant",
|
||||
},
|
||||
wechat: {
|
||||
enabled: true,
|
||||
@@ -184,7 +212,7 @@ const initialSettings: Settings = {
|
||||
mpVerifyCode: "SP8AfZJyAvprRORT",
|
||||
merchantId: "1318592501",
|
||||
apiKey: "wx3e31b068be59ddc131b068be59ddc2",
|
||||
groupQrCode: "", // 微信群二维码链接,管理员配置
|
||||
groupQrCode: "",
|
||||
},
|
||||
usdt: {
|
||||
enabled: true,
|
||||
@@ -234,6 +262,28 @@ const initialSettings: Settings = {
|
||||
liveTime: "06:00-09:00",
|
||||
platform: "Soul派对房",
|
||||
},
|
||||
siteConfig: {
|
||||
siteName: "卡若日记",
|
||||
siteTitle: "一场SOUL的创业实验场",
|
||||
siteDescription: "来自Soul派对房的真实商业故事",
|
||||
logo: "/logo.png",
|
||||
favicon: "/favicon.ico",
|
||||
primaryColor: "#00CED1",
|
||||
},
|
||||
menuConfig: {
|
||||
home: { enabled: true, label: "首页" },
|
||||
chapters: { enabled: true, label: "目录" },
|
||||
match: { enabled: true, label: "匹配" },
|
||||
my: { enabled: true, label: "我的" },
|
||||
},
|
||||
pageConfig: {
|
||||
homeTitle: "一场SOUL的创业实验场",
|
||||
homeSubtitle: "来自Soul派对房的真实商业故事",
|
||||
chaptersTitle: "我要看",
|
||||
matchTitle: "语音匹配",
|
||||
myTitle: "我的",
|
||||
aboutTitle: "关于作者",
|
||||
},
|
||||
}
|
||||
|
||||
export const useStore = create<StoreState>()(
|
||||
@@ -649,6 +699,9 @@ export const useStore = create<StoreState>()(
|
||||
const newSettings: Partial<Settings> = {
|
||||
paymentMethods: mergedPaymentMethods,
|
||||
authorInfo: { ...settings.authorInfo, ...data.authorInfo },
|
||||
siteConfig: { ...settings.siteConfig, ...data.siteConfig },
|
||||
menuConfig: { ...settings.menuConfig, ...data.menuConfig },
|
||||
pageConfig: { ...settings.pageConfig, ...data.pageConfig },
|
||||
}
|
||||
|
||||
set({ settings: { ...settings, ...newSettings } })
|
||||
|
||||
Reference in New Issue
Block a user