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
@@ -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({