Files
wordpress-theme-aksrt/assets/admin/src/constants/sections/index.js
T
kate522 a48007a44d feat(payment): 支付&付费菜单按参考主题重构并新增提现策略页
- 子菜单重组为知识付费/余额充值/VIP会员/创作分成/推广返佣/收款接口/提现策略
- 收款接口页 1:1 复刻 Zibll 双下拉结构,仅保留支付宝/微信/PayPal/Stripe/易支付
- 订单前缀/流水号前缀/提现单号前缀配置保留并移入收款接口页
- 知识付费/推广返佣按参考主题全字段复刻,余额充值并入充值卡配置
- 新增 tabbed/between_number/page_select 表单控件及后端 pages 搜索源
- 清理旧 SPA 组件、无消费者 REST 端点与废弃配置键(不写双路兼容)
- 更新存量契约测试至新 schema 文件
2026-09-16 19:18:28 +08:00

78 lines
2.0 KiB
JavaScript

import { globalSection } from './global'
import { pageDisplaySection } from './page-display'
import { postListSection } from './post-list'
import { permissionsSection } from './permissions'
import { usersSection } from './users'
import { paymentSection } from './payment'
import { extensionsSection } from './extensions'
import { themeInfoSection } from './theme-info'
import { docsSection } from './docs'
import { toolsSection } from './tools'
const SECTION_DEFAULT_CHILDREN = {
global: 'global-common',
'page-display': 'page-display-header-nav',
'post-list': 'post-list-page',
permissions: 'permissions-comment',
users: 'users-auth',
payment: 'payment-knowledge',
extensions: 'extensions-ip',
tools: 'tools-import-export',
'theme-info': 'theme-info-dashboard',
docs: 'docs-dashboard',
}
function attachSectionDefaultRoute(section) {
const defaultChildKey = SECTION_DEFAULT_CHILDREN[section.key]
const defaultChild = (section.children || []).find((child) => child.key === defaultChildKey)
if (!defaultChild) {
return section
}
return {
...section,
defaultRoute: defaultChild.route,
}
}
export const ADMIN_SECTIONS = [
attachSectionDefaultRoute(globalSection),
attachSectionDefaultRoute(pageDisplaySection),
attachSectionDefaultRoute(postListSection),
attachSectionDefaultRoute(permissionsSection),
attachSectionDefaultRoute(usersSection),
attachSectionDefaultRoute(paymentSection),
attachSectionDefaultRoute(extensionsSection),
attachSectionDefaultRoute(toolsSection),
attachSectionDefaultRoute(themeInfoSection),
attachSectionDefaultRoute(docsSection),
]
export function getAdminSections() {
return ADMIN_SECTIONS
}
export function getAllAdminPages() {
const pages = []
for (const section of ADMIN_SECTIONS) {
if (section.placeholder) {
pages.push({
sectionKey: section.key,
...section,
})
continue
}
for (const child of section.children || []) {
pages.push({
sectionKey: section.key,
...child,
})
}
}
return pages
}