feat(admin): add ban/report entry to the users sidebar section
The users SPA section had no ban/report menu item after the queue pages moved to native WP admin. Add a sidebar entry under 用户&互动 that lands on users.php?page=aksrt_user_ban via NativeOpsRedirect, and keep the old /users/report bookmark redirect.
This commit is contained in:
@@ -2,7 +2,8 @@ import { renderFaIcon, schemaPage, customPage } from './helpers'
|
||||
|
||||
/**
|
||||
* Users SPA keeps config-shaped pages.
|
||||
* Message / referral-code / ban / report queues live under users.php native menus.
|
||||
* Message / referral-code queues live under users.php native menus;
|
||||
* 封禁/举报 gets a sidebar entry that lands on the native ban page.
|
||||
*/
|
||||
export const usersSection = {
|
||||
key: 'users',
|
||||
@@ -128,5 +129,19 @@ export const usersSection = {
|
||||
canonicalDomain: 'users',
|
||||
section: 'wechat-template',
|
||||
}),
|
||||
customPage({
|
||||
key: 'users-ban',
|
||||
name: 'UsersBan',
|
||||
label: '封禁/举报',
|
||||
route: '/users/ban',
|
||||
component: 'NativeOpsRedirect',
|
||||
status: 'available',
|
||||
title: '封禁/举报',
|
||||
desc: '举报工单、禁封限制与申诉审核,统一在 WordPress 用户菜单处理。',
|
||||
iconClass: 'fa fas fa-gavel',
|
||||
canonicalDomain: 'users',
|
||||
section: 'ban',
|
||||
nativeAdminPath: 'users.php?page=aksrt_user_ban&tab=reports',
|
||||
}),
|
||||
],
|
||||
}
|
||||
|
||||
@@ -40,6 +40,10 @@ function createRouteMeta(page) {
|
||||
meta.section = page.section
|
||||
}
|
||||
|
||||
if (page.nativeAdminPath) {
|
||||
meta.nativeAdminPath = page.nativeAdminPath
|
||||
}
|
||||
|
||||
if (page.component === 'DeferredPage') {
|
||||
meta.deferred = true
|
||||
meta.deferredProps = {
|
||||
@@ -74,11 +78,11 @@ function createSectionRedirectRoutes() {
|
||||
/**
|
||||
* Old SPA ops routes → native WP admin pages.
|
||||
* Bookmarks under order-related paths land on NativeOpsRedirect.
|
||||
* (封禁/举报 as a sidebar entry lives in constants/sections/users.js → /users/ban.)
|
||||
*/
|
||||
const NATIVE_OPS_REDIRECTS = [
|
||||
{ path: '/users/messages', title: '消息中心', nativeAdminPath: 'users.php?page=aksrt_messages' },
|
||||
{ path: '/users/referral-codes', title: '推广码运营', nativeAdminPath: 'users.php?page=aksrt_referral_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' },
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user