87 lines
11 KiB
TypeScript
87 lines
11 KiB
TypeScript
import type { RouteRecordRaw } from 'vue-router'
|
|
|
|
/** 常量:可访问路由的 meta 键约定(title/menu/roles/icon)。 */
|
|
export interface RouteMetaExt {
|
|
title?: string
|
|
icon?: string
|
|
menu?: boolean
|
|
roles?: string[]
|
|
group?: string
|
|
subtitle?: string // E3:page-head 副题(11px dim;MainLayout 注入)
|
|
}
|
|
|
|
declare module 'vue-router' {
|
|
interface RouteMeta extends RouteMetaExt {}
|
|
}
|
|
|
|
/** 公共路由(无需登录)。 */
|
|
export const publicRoutes: RouteRecordRaw[] = [
|
|
{ path: '/login', name: 'login', component: () => import('@/views/login/LoginView.vue') },
|
|
{ path: '/:pathMatch(.*)*', name: 'not-found', component: () => import('@/views/error/NotFound.vue') },
|
|
]
|
|
|
|
/** 业务路由(需登录,按 roles 过滤;18 模块地图与需求文档一致,P2 业务线为占位引导页)。 */
|
|
export const asyncRoutes: RouteRecordRaw[] = [
|
|
{
|
|
path: '/',
|
|
component: () => import('@/layouts/MainLayout.vue'),
|
|
redirect: '/home',
|
|
children: [
|
|
{ path: 'home', name: 'home', component: () => import('@/views/home/DashboardView.vue'), meta: { title: '运营总览', icon: 'HomeFilled', menu: true, group: '工作台', subtitle: '今日平台运行概览 · 60s 自动刷新', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'notice', name: 'notice', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '预警公告', icon: 'Bell', menu: true, group: '工作台', roles: ['admin', 'ops', 'service', 'group'] } },
|
|
|
|
{ path: 'account', name: 'account-list', component: () => import('@/views/account/AccountList.vue'), meta: { title: '帐号管理', icon: 'User', menu: true, group: '运营管理', roles: ['admin', 'ops'] } },
|
|
{ path: 'account/create', name: 'account-create', component: () => import('@/views/account/AccountCreate.vue'), meta: { title: '开户', group: '运营管理', roles: ['admin', 'ops'] } },
|
|
{ path: 'account/:id', name: 'account-detail', component: () => import('@/views/account/AccountDetail.vue'), meta: { title: '账号详情', group: '运营管理', roles: ['admin', 'ops'] } },
|
|
{ path: 'account/:id/recharge', name: 'account-recharge', component: () => import('@/views/account/AccountRecharge.vue'), meta: { title: '充值', group: '运营管理', roles: ['admin', 'ops'] } },
|
|
{ path: 'account/roles', name: 'account-roles', component: () => import('@/views/account/RoleManage.vue'), meta: { title: '角色权限', group: '运营管理', roles: ['admin'] } },
|
|
{ path: 'audit', name: 'audit', component: () => import('@/views/audit/center/index.vue'), meta: { title: '审核中心', icon: 'Stamp', menu: true, group: '运营管理', roles: ['admin', 'ops', 'service'] } },
|
|
{ path: 'audit/login', name: 'audit-login', component: () => import('@/views/audit/LoginAudit.vue'), meta: { title: '登录审计', group: '运营管理', roles: ['admin', 'ops'] } },
|
|
|
|
{ path: 'sms', name: 'sms', redirect: '/sms/home', meta: { title: '短信业务', group: '业务中心' } },
|
|
{ path: 'sms/home', name: 'sms-home', component: () => import('@/views/sms/home/index.vue'), meta: { title: '短信聚合页', icon: 'MessageBox', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/batch', name: 'sms-batch', component: () => import('@/views/sms/batch/index.vue'), meta: { title: '群发工作台', icon: 'ChatDotRound', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/personal', name: 'sms-personal', component: () => import('@/views/sms/personal/index.vue'), meta: { title: '个性短信', icon: 'EditPen', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/timer', name: 'sms-timer', component: () => import('@/views/sms/timer/index.vue'), meta: { title: '定时任务', icon: 'Timer', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/result', name: 'sms-result', component: () => import('@/views/sms/result/index.vue'), meta: { title: '发送结果反馈', icon: 'DataAnalysis', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/template', name: 'sms-template', component: () => import('@/views/sms/template/index.vue'), meta: { title: '模板管理', icon: 'Document', menu: true, group: '业务中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'sms/downlink-detail', name: 'sms-downlink-detail', component: () => import('@/views/sms/downlink-detail/index.vue'), meta: { title: '短信下行明细', icon: 'Tickets', menu: true, group: '记录中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'video', name: 'video', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '视频业务', icon: 'VideoCamera', menu: true, group: '业务中心', roles: ['admin', 'ops'] } },
|
|
{ path: 'csp', name: 'csp', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: 'CSP业务', icon: 'Iphone', menu: true, group: '业务中心', roles: ['admin', 'ops'] } },
|
|
{ path: 'nullfilter', name: 'nullfilter', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '空号业务', icon: 'CircleClose', menu: true, group: '业务中心', roles: ['admin', 'ops'] } },
|
|
{ path: 'shortlink', name: 'shortlink', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '短链业务', icon: 'Link', menu: true, group: '业务中心', roles: ['admin', 'ops'] } },
|
|
|
|
// 记录中心(FE-4,D24 起;契约先行 mock,Day60 联调)
|
|
{ path: 'record/down', name: 'record-down', component: () => import('@/views/record/down/index.vue'), meta: { title: '下行记录', icon: 'List', menu: true, group: '记录中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'record/detail', name: 'record-detail', redirect: (to) => ({ path: '/sms/downlink-detail', query: { ...to.query, batch_id: (to.query.task_no ?? to.query.batch_id) as string | undefined } }), meta: { title: '下行明细', menu: false, group: '记录中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'record/up', name: 'record-up', component: () => import('@/views/record/uplink/index.vue'), meta: { title: '上行记录', menu: true, group: '记录中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
{ path: 'record/repush', name: 'record-repush', component: () => import('@/views/record/repush/index.vue'), meta: { title: '回执工具', menu: true, group: '记录中心', roles: ['admin', 'ops', 'service'] } },
|
|
{ path: 'record/history', name: 'record-history', component: () => import('@/views/record/history/index.vue'), meta: { title: '历史记录', menu: false, group: '记录中心', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
|
|
{ path: 'channel', name: 'channel', component: () => import('@/views/channel/ChannelList.vue'), meta: { title: '通道配置', icon: 'Connection', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'channel/upstream', name: 'channel-upstream', component: () => import('@/views/channel/UpstreamList.vue'), meta: { title: '上家管理', icon: 'OfficeBuilding', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'channel/edit/:id?', name: 'channel-edit', component: () => import('@/views/channel/ChannelEdit.vue'), meta: { title: '通道编辑', group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'channel/group', name: 'channel-group', component: () => import('@/views/channel/ChannelGroup.vue'), meta: { title: '通道组路由', icon: 'Share', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'policy', name: 'policy', component: () => import('@/views/policy/PolicyCenter.vue'), meta: { title: '规则策略', icon: 'SetUp', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'policy/route', name: 'policy-route', component: () => import('@/views/policy/RouteRule.vue'), meta: { title: '导流策略', icon: 'Guide', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'policy/report', name: 'policy-report', component: () => import('@/views/policy/Report.vue'), meta: { title: '签名/码号报备', icon: 'Stamp', menu: true, group: '通道与策略', roles: ['admin', 'ops'] } },
|
|
{ path: 'contacts', name: 'contacts', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '通讯录', icon: 'Notebook', menu: true, group: '通道与策略', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
|
|
{ path: 'stats/user', name: 'stats-user', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '用户统计', icon: 'DataLine', menu: true, group: '统计结算', roles: ['admin', 'ops', 'service'] } },
|
|
{ path: 'stats/channel', name: 'stats-channel', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '通道统计', icon: 'TrendCharts', menu: true, group: '统计结算', roles: ['admin', 'ops'] } },
|
|
{ path: 'stats/profit', name: 'stats-profit', component: () => import('@/views/stats/profit/index.vue'), meta: { title: '利润分析', icon: 'Coin', menu: true, group: '统计结算', roles: ['admin', 'ops', 'service'], subtitle: '用户利润(含下级返点)· 通道利润 · 平台净利' } },
|
|
{ path: 'settle', name: 'settle', component: () => import('@/views/settle/index.vue'), meta: { title: '结算管理', icon: 'Wallet', menu: true, group: '统计结算', roles: ['admin', 'ops'] } },
|
|
{ path: 'ops/callback', name: 'ops-callback', component: () => import('@/views/ops/callback/index.vue'), meta: { title: '回调管理', icon: 'Promotion', menu: true, group: '系统管理', roles: ['admin', 'ops'], subtitle: '客户回调推送任务 · 指数退避 · 死信可查可重派' } },
|
|
|
|
|
|
{ path: 'logs', name: 'logs', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '日志报表', icon: 'Document', menu: true, group: '系统管理', roles: ['admin', 'ops', 'service'] } },
|
|
{ path: 'system', name: 'system', component: () => import('@/views/system/index.vue'), meta: { title: '系统配置', icon: 'Setting', menu: true, group: '系统管理', roles: ['admin'], subtitle: '系统级参数 KV · 默认接入码 · 拉黑词表' } },
|
|
{ path: 'faq', name: 'faq', component: () => import('@/views/coming/ComingSoon.vue'), meta: { title: '常见问题', icon: 'QuestionFilled', menu: true, group: '系统管理', roles: ['admin', 'ops', 'service', 'group', 'customer'] } },
|
|
|
|
// 隐藏页(不在菜单)
|
|
{ path: '403', name: 'forbidden', component: () => import('@/views/error/Forbidden.vue'), meta: { title: '无权限' } },
|
|
{ path: '500', name: 'server-error', component: () => import('@/views/error/ServerError.vue'), meta: { title: '服务异常' } },
|
|
],
|
|
},
|
|
]
|