支持配置后台页面入口
This commit is contained in:
@@ -32,6 +32,7 @@ import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
import { changeAdminPassword, logoutAdmin, updateSupportStatus } from '@/features/admin'
|
||||
import { useAdminSessionStore } from '@/stores/adminSession'
|
||||
import { adminPath, ADMIN_DASHBOARD_PATH, ADMIN_LOGIN_PATH } from '@/shared/utils/adminPath'
|
||||
import { readError } from '@/shared/utils/error'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -66,7 +67,7 @@ const allNavGroups: NavGroup[] = [
|
||||
index: 'workspace',
|
||||
icon: House,
|
||||
children: [
|
||||
{ label: '仪表盘', to: '/admin/dashboard', icon: DataLine, permission: 'dashboard:view' },
|
||||
{ label: '仪表盘', to: ADMIN_DASHBOARD_PATH, icon: DataLine, permission: 'dashboard:view' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -74,12 +75,12 @@ const allNavGroups: NavGroup[] = [
|
||||
index: 'business',
|
||||
icon: Briefcase,
|
||||
children: [
|
||||
{ label: '用户管理', to: '/admin/users', icon: User, permission: 'user:view' },
|
||||
{ label: '订单管理', to: '/admin/orders', icon: Tickets, permission: 'order:view' },
|
||||
{ label: '商品管理', to: '/admin/listings', icon: Shop, permission: 'listing:view' },
|
||||
{ label: '用户管理', to: adminPath('users'), icon: User, permission: 'user:view' },
|
||||
{ label: '订单管理', to: adminPath('orders'), icon: Tickets, permission: 'order:view' },
|
||||
{ label: '商品管理', to: adminPath('listings'), icon: Shop, permission: 'listing:view' },
|
||||
{
|
||||
label: '商品审核',
|
||||
to: '/admin/listings/review',
|
||||
to: adminPath('listings/review'),
|
||||
icon: DocumentChecked,
|
||||
permission: 'listing:approve',
|
||||
},
|
||||
@@ -92,11 +93,11 @@ const allNavGroups: NavGroup[] = [
|
||||
children: [
|
||||
{
|
||||
label: '仲裁中心',
|
||||
to: '/admin/disputes',
|
||||
to: adminPath('disputes'),
|
||||
icon: ScaleToOriginal,
|
||||
permission: 'dispute:view',
|
||||
},
|
||||
{ label: '客服群聊', to: '/admin/chats', icon: ChatDotRound, permission: 'chat:view' },
|
||||
{ label: '客服群聊', to: adminPath('chats'), icon: ChatDotRound, permission: 'chat:view' },
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -106,22 +107,22 @@ const allNavGroups: NavGroup[] = [
|
||||
children: [
|
||||
{
|
||||
label: '财务仪表盘',
|
||||
to: '/admin/finance/dashboard',
|
||||
to: adminPath('finance/dashboard'),
|
||||
icon: DataLine,
|
||||
permission: 'wallet:view',
|
||||
},
|
||||
{
|
||||
label: '财务明细',
|
||||
to: '/admin/finance/details',
|
||||
to: adminPath('finance/details'),
|
||||
icon: Document,
|
||||
permission: 'wallet:view',
|
||||
},
|
||||
{ label: '资金流水', to: '/admin/wallet-ledger', icon: Wallet, permission: 'wallet:view' },
|
||||
{ label: '支付流水', to: '/admin/payments', icon: CreditCard, permission: 'wallet:view' },
|
||||
{ label: '提现审核', to: '/admin/withdrawals', icon: Money, permission: 'withdrawal:list' },
|
||||
{ label: '资金流水', to: adminPath('wallet-ledger'), icon: Wallet, permission: 'wallet:view' },
|
||||
{ label: '支付流水', to: adminPath('payments'), icon: CreditCard, permission: 'wallet:view' },
|
||||
{ label: '提现审核', to: adminPath('withdrawals'), icon: Money, permission: 'withdrawal:list' },
|
||||
{
|
||||
label: '支付配置',
|
||||
to: '/admin/payment-configs',
|
||||
to: adminPath('payment-configs'),
|
||||
icon: CreditCard,
|
||||
permission: 'payment_config:list',
|
||||
},
|
||||
@@ -134,13 +135,13 @@ const allNavGroups: NavGroup[] = [
|
||||
children: [
|
||||
{
|
||||
label: '公告管理',
|
||||
to: '/admin/announcements',
|
||||
to: adminPath('announcements'),
|
||||
icon: Bell,
|
||||
permission: 'announcement:view',
|
||||
},
|
||||
{
|
||||
label: '系统配置',
|
||||
to: '/admin/system-configs',
|
||||
to: adminPath('system-configs'),
|
||||
icon: Operation,
|
||||
permission: 'system_config:view',
|
||||
},
|
||||
@@ -151,14 +152,14 @@ const allNavGroups: NavGroup[] = [
|
||||
index: 'system-auth',
|
||||
icon: Lock,
|
||||
children: [
|
||||
{ label: '审计日志', to: '/admin/audit-logs', icon: Document, permission: 'audit_log:view' },
|
||||
{ label: '审计日志', to: adminPath('audit-logs'), icon: Document, permission: 'audit_log:view' },
|
||||
{
|
||||
label: '管理员管理',
|
||||
to: '/admin/admin-users',
|
||||
to: adminPath('admin-users'),
|
||||
icon: UserFilled,
|
||||
permission: 'admin_user:manage',
|
||||
},
|
||||
{ label: '角色管理', to: '/admin/roles', icon: Setting, permission: 'role:manage' },
|
||||
{ label: '角色管理', to: adminPath('roles'), icon: Setting, permission: 'role:manage' },
|
||||
],
|
||||
},
|
||||
]
|
||||
@@ -236,7 +237,7 @@ async function handleLogout() {
|
||||
}
|
||||
adminSession.logout()
|
||||
ElMessage.success('已退出后台')
|
||||
await router.push('/admin/login')
|
||||
await router.push(ADMIN_LOGIN_PATH)
|
||||
}
|
||||
|
||||
function passwordStrongEnough(value: string) {
|
||||
@@ -264,7 +265,7 @@ async function handleForcedPasswordChange() {
|
||||
})
|
||||
ElMessage.success('密码已修改,请重新登录')
|
||||
adminSession.logout()
|
||||
await router.replace('/admin/login')
|
||||
await router.replace(ADMIN_LOGIN_PATH)
|
||||
} catch (error) {
|
||||
ElMessage.error(readError(error, '密码修改失败'))
|
||||
} finally {
|
||||
@@ -277,7 +278,7 @@ async function handleForcedPasswordChange() {
|
||||
<div class="admin-shell" :class="{ 'admin-shell--collapsed': isCollapsed }">
|
||||
<aside class="admin-sidebar">
|
||||
<div class="admin-sidebar-header">
|
||||
<RouterLink class="admin-brand" to="/admin/dashboard">
|
||||
<RouterLink class="admin-brand" :to="ADMIN_DASHBOARD_PATH">
|
||||
<span class="brand-mark">H</span>
|
||||
<span class="brand-text" v-show="!isCollapsed">哈夫币后台</span>
|
||||
</RouterLink>
|
||||
@@ -318,7 +319,7 @@ async function handleForcedPasswordChange() {
|
||||
<header class="admin-topbar">
|
||||
<div class="topbar-left">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item :to="{ path: '/admin/dashboard' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item :to="{ path: ADMIN_DASHBOARD_PATH }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item v-if="route.meta.title">{{ route.meta.title }}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user