feat(admin): strip SPA ops menus; redirect old hashes to native WP (Phase 4)

SPA shop/forum/payment/users sections now keep configuration pages only.
Operational workbenches were removed from the sidebar and loaders; legacy
hash routes open NativeOpsRedirect into the matching WP native admin page.
Admin SPA production build refreshed accordingly.
This commit is contained in:
2026-07-15 02:10:05 +08:00
parent bf061f43ee
commit a3dde3874a
85 changed files with 15987 additions and 249 deletions
+2 -57
View File
@@ -1,33 +1,12 @@
import { renderFaIcon, schemaPage, customPage } from './helpers'
import { renderFaIcon, schemaPage } from './helpers'
// Forum SPA = config only. Ops moved to native CPT menus (Phase 4).
export const forumSection = {
key: 'forum',
label: '社区&论坛',
icon: renderFaIcon('fas fa-comments'),
route: '/forum',
children: [
customPage({
key: 'forum-boards',
name: 'ForumBoards',
label: '板块管理',
route: '/forum/boards',
component: 'ForumBoards',
title: '板块管理',
desc: '创建、编辑和排序论坛板块。',
canonicalDomain: 'forum',
section: 'boards',
}),
customPage({
key: 'forum-topics',
name: 'ForumTopics',
label: '主题治理',
route: '/forum/topics',
component: 'ForumTopics',
title: '主题治理',
desc: '集中处理主题审核、可见性、版块移动和治理状态。',
canonicalDomain: 'forum',
section: 'topics',
}),
schemaPage({
key: 'forum-settings-basic',
name: 'ForumSettingsBasic',
@@ -128,39 +107,5 @@ export const forumSection = {
canonicalDomain: 'forum',
section: 'credits',
}),
customPage({
key: 'forum-moderator-applications',
name: 'ForumModeratorApplications',
label: '版主申请',
route: '/forum/moderator-applications',
component: 'ForumModeratorApplications',
title: '版主申请',
desc: '处理前台版主申请和审核结果反馈。',
canonicalDomain: 'forum',
section: 'moderator-applications',
}),
customPage({
key: 'forum-moderators',
name: 'ForumModerators',
label: '版主管理',
route: '/forum/moderators',
component: 'ForumModerators',
title: '版主管理',
desc: '为每个论坛版块分配和管理版主。',
canonicalDomain: 'forum',
section: 'moderators',
}),
customPage({
key: 'forum-dashboard',
name: 'ForumDashboard',
label: '论坛概览',
route: '/forum/dashboard',
component: 'ForumDashboard',
title: '论坛概览',
desc: '社区讨论、帖子管理、版块配置等论坛功能概览。',
canonicalDomain: 'forum',
section: 'dashboard',
secondaryEntry: true,
}),
],
}
+2 -2
View File
@@ -18,8 +18,8 @@ const SECTION_DEFAULT_CHILDREN = {
permissions: 'permissions-comment',
users: 'users-auth',
payment: 'payment-paid',
shop: 'shop-products',
forum: 'forum-boards',
shop: 'shop-basic',
forum: 'forum-settings-basic',
extensions: 'extensions-ip',
tools: 'tools-import-export',
'theme-info': 'theme-info-dashboard',
+3 -39
View File
@@ -60,18 +60,6 @@ export const paymentSection = {
canonicalDomain: 'payment',
section: 'order',
}),
customPage({
key: 'payment-revenue',
name: 'PaymentRevenue',
label: '创作分成',
route: '/payment/revenue',
component: 'PaymentRevenue',
status: 'available',
title: '创作分成',
desc: '创作者收益分配和结算记录。',
canonicalDomain: 'payment',
section: 'revenue',
}),
schemaPage({
key: 'payment-affiliate',
name: 'PaymentAffiliate',
@@ -79,22 +67,10 @@ export const paymentSection = {
route: '/payment/affiliate',
status: 'available',
title: '推广返佣',
desc: '返佣规则、邀请链路和结算记录。',
desc: '返佣规则、邀请链路和结算策略(返佣工单在支付中心)。',
canonicalDomain: 'payment',
section: 'affiliate',
}),
customPage({
key: 'payment-charge-card',
name: 'PaymentChargeCard',
label: '充值卡',
route: '/payment/charge-card',
component: 'PaymentChargeCard',
status: 'available',
title: '充值卡',
desc: '创建和管理充值卡。',
canonicalDomain: 'payment',
section: 'charge-card',
}),
schemaPage({
key: 'payment-card-pass',
name: 'PaymentCardPass',
@@ -102,7 +78,7 @@ export const paymentSection = {
route: '/payment/card-pass',
status: 'available',
title: '卡密设置',
desc: '充值卡类型、卡号规则与兑换文案。',
desc: '充值卡类型、卡号规则与兑换文案(卡密工单在支付中心)。',
canonicalDomain: 'payment',
section: 'card-pass',
}),
@@ -113,21 +89,9 @@ export const paymentSection = {
route: '/payment/withdrawal',
status: 'available',
title: '提现策略',
desc: '最低提现、手续费与说明文案(提现工单在商城提现管理)。',
desc: '最低提现、手续费与说明文案(提现工单在支付中心)。',
canonicalDomain: 'payment',
section: 'withdrawal',
}),
customPage({
key: 'payment-rebate',
name: 'PaymentRebate',
label: '返佣管理',
route: '/payment/rebate',
component: 'PaymentRebate',
status: 'available',
title: '返佣管理',
desc: '管理订单返佣和推广返佣记录。',
canonicalDomain: 'payment',
section: 'rebate',
}),
],
}
+2 -79
View File
@@ -1,33 +1,12 @@
import { renderFaIcon, schemaPage, customPage } from './helpers'
import { renderFaIcon, schemaPage } from './helpers'
// Shop SPA = config only. Ops moved to native WP menus (Phase 4).
export const shopSection = {
key: 'shop',
label: '商城&商品',
icon: renderFaIcon('fas fa-shopping-cart'),
route: '/shop',
children: [
customPage({
key: 'shop-products',
name: 'ShopProducts',
label: '商品管理',
route: '/shop/products',
component: 'ShopProducts',
title: '商品管理',
desc: '管理所有商品的上架、编辑和库存。',
canonicalDomain: 'shop',
section: 'products',
}),
customPage({
key: 'shop-orders',
name: 'ShopOrders',
label: '订单管理',
route: '/shop/orders',
component: 'ShopOrders',
title: '订单管理',
desc: '查看和管理所有交易订单。',
canonicalDomain: 'shop',
section: 'orders',
}),
schemaPage({
key: 'shop-basic',
name: 'ShopBasic',
@@ -78,28 +57,6 @@ export const shopSection = {
canonicalDomain: 'shop',
section: 'contact',
}),
customPage({
key: 'shop-after-sale',
name: 'ShopAfterSale',
label: '售后管理',
route: '/shop/after-sale',
component: 'ShopAfterSale',
title: '售后管理',
desc: '管理退款、换货等售后工单。',
canonicalDomain: 'shop',
section: 'after-sale',
}),
customPage({
key: 'shop-shipping',
name: 'ShopShipping',
label: '物流管理',
route: '/shop/shipping',
component: 'ShopShipping',
title: '物流管理',
desc: '管理订单发货、物流单号和发货状态。',
canonicalDomain: 'shop',
section: 'shipping',
}),
schemaPage({
key: 'shop-shipping-config',
name: 'ShopShippingConfig',
@@ -120,39 +77,5 @@ export const shopSection = {
canonicalDomain: 'shop',
section: 'timing',
}),
customPage({
key: 'shop-coupons',
name: 'ShopCoupons',
label: '优惠券',
route: '/shop/coupons',
component: 'ShopCoupons',
title: '优惠券',
desc: '创建和管理优惠券。',
canonicalDomain: 'shop',
section: 'coupons',
}),
customPage({
key: 'shop-withdrawals',
name: 'ShopWithdrawals',
label: '提现管理',
route: '/shop/withdrawals',
component: 'ShopWithdrawals',
title: '提现管理',
desc: '审核和管理创作者提现申请。',
canonicalDomain: 'shop',
section: 'withdrawals',
}),
customPage({
key: 'shop-dashboard',
name: 'ShopDashboard',
label: '商城概览',
route: '/shop/dashboard',
component: 'ShopDashboard',
title: '商城概览',
desc: '商品管理、订单系统、库存管理等电商功能概览。',
canonicalDomain: 'shop',
section: 'dashboard',
secondaryEntry: true,
}),
],
}
+5 -48
View File
@@ -1,5 +1,9 @@
import { renderFaIcon, schemaPage, customPage } from './helpers'
/**
* Users SPA keeps config-shaped pages.
* Message / invite / ban / report queues live under users.php native menus.
*/
export const usersSection = {
key: 'users',
label: '用户&互动',
@@ -67,7 +71,7 @@ export const usersSection = {
component: 'UsersVerify',
status: 'available',
title: '身份认证',
desc: '身份认证字段、审核流和展示标签。',
desc: '身份认证字段与展示配置(审核队列在 用户 → 身份认证)。',
canonicalDomain: 'users',
section: 'verify',
}),
@@ -105,53 +109,6 @@ export const usersSection = {
canonicalDomain: 'users',
section: 'notifications',
}),
customPage({
key: 'users-messages',
name: 'UsersMessages',
label: '消息中心',
route: '/users/messages',
component: 'UsersMessages',
status: 'available',
title: '消息中心',
desc: '管理站内通知、系统消息和用户私信记录。',
canonicalDomain: 'users',
section: 'messages',
}),
customPage({
key: 'users-invite-codes',
name: 'UsersInviteCodes',
label: '邀请码运营',
route: '/users/invite-codes',
component: 'UsersInviteCodes',
title: '邀请码运营',
desc: '管理邀请码列表、生成新邀请码和查看邀请统计。',
canonicalDomain: 'users',
section: 'invite-codes',
}),
customPage({
key: 'users-ban',
name: 'UsersBan',
label: '禁封管理',
route: '/users/ban',
component: 'UsersBan',
status: 'available',
title: '禁封管理',
desc: '查看和管理用户封禁、限制状态。',
canonicalDomain: 'users',
section: 'ban',
}),
customPage({
key: 'users-report',
name: 'UsersReport',
label: '禁封/举报',
route: '/users/report',
component: 'UsersReport',
status: 'available',
title: '禁封/举报',
desc: '举报受理与用户限制状态管理。',
canonicalDomain: 'users',
section: 'report',
}),
schemaPage({
key: 'users-sms',
name: 'UsersSms',
@@ -0,0 +1,57 @@
<template>
<div class="aks-native-ops-redirect">
<h2>{{ title }}</h2>
<p class="desc">
此运营功能已迁移到 WordPress 原生后台侧栏(对齐 zibll)。正在跳转…
</p>
<p v-if="nativeUrl">
<a class="button button-primary" :href="nativeUrl">立即打开原生页面</a>
</p>
<p v-else class="desc">未配置原生跳转地址,请从左侧 WP 菜单进入。</p>
</div>
</template>
<script setup>
import { computed, onMounted } from 'vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const title = computed(() => route.meta?.title || '运营功能已迁移')
const nativeUrl = computed(() => {
const path = route.meta?.nativeAdminPath || ''
if (!path) return ''
const base = (window.aksrtAdminData?.adminUrl || '/wp-admin/').replace(/\/?$/, '/')
return base + path.replace(/^\//, '')
})
onMounted(() => {
if (nativeUrl.value) {
window.location.replace(nativeUrl.value)
}
})
</script>
<style scoped>
.aks-native-ops-redirect {
max-width: 640px;
margin: 48px auto;
padding: 24px;
background: var(--aks-surface, #fff);
border-radius: 8px;
border: 1px solid var(--aks-border, #e5e7eb);
}
.desc {
color: #646970;
line-height: 1.6;
}
.button {
display: inline-block;
margin-top: 8px;
padding: 8px 14px;
background: #2271b1;
color: #fff;
border-radius: 4px;
text-decoration: none;
}
</style>
@@ -1,6 +1,7 @@
export const corePageLoaders = {
SchemaPage: () => import('@/pages/SchemaPage.vue'),
DeferredPage: () => import('@/components/DeferredPage.vue'),
NativeOpsRedirect: () => import('@/pages/placeholder/NativeOpsRedirect.vue'),
FloatingButtonsSettings: () => import('@/pages/content/FloatingButtonsSettings.vue'),
FooterTabbarSettings: () => import('@/pages/content/FooterTabbarSettings.vue'),
FooterSettings: () => import('@/pages/content/FooterSettings.vue'),
@@ -1,7 +1,2 @@
export const forumPageLoaders = {
ForumDashboard: () => import('@/pages/forum/ForumDashboard.vue'),
ForumBoards: () => import('@/pages/forum/ForumBoards.vue'),
ForumTopics: () => import('@/pages/forum/ForumTopics.vue'),
ForumModerators: () => import('@/pages/forum/ForumModerators.vue'),
ForumModeratorApplications: () => import('@/pages/forum/ForumModeratorApplications.vue'),
}
// Forum ops Vue pages removed (Phase 4). Config uses SchemaPage.
export const forumPageLoaders = {}
@@ -1,6 +1,3 @@
export const paymentPageLoaders = {
PaymentRevenue: () => import('@/pages/payment/PaymentRevenue.vue'),
PaymentGateway: () => import('@/pages/payment/PaymentGateway.vue'),
PaymentChargeCard: () => import('@/pages/payment/PaymentChargeCard.vue'),
PaymentRebate: () => import('@/pages/payment/PaymentRebate.vue'),
}
@@ -1,9 +1,2 @@
export const shopPageLoaders = {
ShopDashboard: () => import('@/pages/shop/ShopDashboard.vue'),
ShopProducts: () => import('@/pages/shop/ShopProducts.vue'),
ShopOrders: () => import('@/pages/shop/ShopOrders.vue'),
ShopWithdrawals: () => import('@/pages/shop/ShopWithdrawals.vue'),
ShopCoupons: () => import('@/pages/shop/ShopCoupons.vue'),
ShopAfterSale: () => import('@/pages/shop/ShopAfterSale.vue'),
ShopShipping: () => import('@/pages/shop/ShopShipping.vue'),
}
// Shop ops Vue pages removed (Phase 4). Config uses SchemaPage.
export const shopPageLoaders = {}
@@ -1,12 +1,8 @@
export const usersPageLoaders = {
UsersFeatures: () => import('@/pages/users/UsersFeatures.vue'),
UsersSignin: () => import('@/pages/users/UsersSignin.vue'),
UsersInviteCodes: () => import('@/pages/users/UsersInviteCodes.vue'),
UsersVerify: () => import('@/pages/users/UsersVerify.vue'),
UsersLevel: () => import('@/pages/users/UsersLevel.vue'),
UsersBadge: () => import('@/pages/users/UsersBadge.vue'),
UsersReport: () => import('@/pages/users/UsersReport.vue'),
UsersMessages: () => import('@/pages/users/UsersMessages.vue'),
UsersBan: () => import('@/pages/users/UsersBan.vue'),
UsersWechatTemplate: () => import('@/pages/users/UsersWechatTemplate.vue'),
}
+36
View File
@@ -71,6 +71,32 @@ function createSectionRedirectRoutes() {
})
}
/**
* Old SPA ops routes → native WP admin pages (Phase 4 transition).
* Bookmarks under #/shop/products etc. land on NativeOpsRedirect.
*/
const NATIVE_OPS_REDIRECTS = [
{ path: '/shop/products', title: '商品管理', nativeAdminPath: 'edit.php?post_type=aksrt_product' },
{ path: '/shop/orders', title: '订单管理', nativeAdminPath: 'admin.php?page=aksrt_orders' },
{ path: '/shop/after-sale', title: '售后管理', nativeAdminPath: 'admin.php?page=aksrt_after_sale' },
{ path: '/shop/shipping', title: '物流管理', nativeAdminPath: 'admin.php?page=aksrt_shipping' },
{ path: '/shop/coupons', title: '优惠券', nativeAdminPath: 'admin.php?page=aksrt_coupons' },
{ path: '/shop/withdrawals', title: '提现管理', nativeAdminPath: 'admin.php?page=aksrt_withdraw' },
{ path: '/shop/dashboard', title: '商城概览', nativeAdminPath: 'admin.php?page=aksrt_pay' },
{ path: '/forum/boards', title: '板块管理', nativeAdminPath: 'edit.php?post_type=aksrt_forum_plate' },
{ path: '/forum/topics', title: '主题治理', nativeAdminPath: 'edit.php?post_type=aksrt_forum_topic' },
{ path: '/forum/moderators', title: '版主管理', nativeAdminPath: 'edit.php?post_type=aksrt_forum_plate' },
{ path: '/forum/moderator-applications', title: '版主申请', nativeAdminPath: 'edit.php?post_type=aksrt_forum_plate' },
{ path: '/forum/dashboard', title: '论坛概览', nativeAdminPath: 'edit.php?post_type=aksrt_forum_topic' },
{ path: '/payment/charge-card', title: '充值卡', nativeAdminPath: 'admin.php?page=aksrt_charge_cards' },
{ path: '/payment/revenue', title: '创作分成', nativeAdminPath: 'admin.php?page=aksrt_income' },
{ path: '/payment/rebate', title: '返佣管理', nativeAdminPath: 'admin.php?page=aksrt_rebate' },
{ path: '/users/messages', title: '消息中心', nativeAdminPath: 'users.php?page=aksrt_messages' },
{ path: '/users/invite-codes', title: '邀请码运营', nativeAdminPath: 'users.php?page=aksrt_invite_codes' },
{ path: '/users/ban', title: '禁封管理', nativeAdminPath: 'users.php?page=aksrt_user_ban&tab=restrictions' },
{ path: '/users/report', title: '禁封/举报', nativeAdminPath: 'users.php?page=aksrt_user_ban&tab=reports' },
]
const routes = [
{ path: '/', redirect: ADMIN_DEFAULT_ROUTE },
...createSectionRedirectRoutes(),
@@ -80,6 +106,16 @@ const routes = [
component: resolveComponent(page),
meta: createRouteMeta(page),
})),
...NATIVE_OPS_REDIRECTS.map((item) => ({
path: item.path,
name: `NativeRedirect_${item.path.replace(/\W+/g, '_')}`,
component: componentLoaders.NativeOpsRedirect,
meta: {
title: item.title,
nativeAdminPath: item.nativeAdminPath,
status: 'redirect',
},
})),
]
export default createRouter({