第一次提交:Vue3后台前端最新版本
This commit is contained in:
247
src/router/index.js
Normal file
247
src/router/index.js
Normal file
@@ -0,0 +1,247 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import Layout from '@/views/Layout.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/Login.vue')
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: '/order/platform',
|
||||
children: [
|
||||
|
||||
|
||||
// ========== 板块与财务 ==========
|
||||
{
|
||||
path: 'finance/bankuai',
|
||||
component: () => import('@/views/finance/BankuaiConfig.vue'),
|
||||
meta: { title: '板块配置' }
|
||||
},
|
||||
{
|
||||
path: 'finance/data',
|
||||
component: () => import('@/views/finance/FinanceData.vue'),
|
||||
meta: { title: '财务数据' }
|
||||
},
|
||||
|
||||
// ========== 考核管理 ==========
|
||||
{
|
||||
path: 'assessment/examiner',
|
||||
component: () => import('@/views/assessment/ExaminerManage.vue'),
|
||||
meta: { title: '考核官管理' }
|
||||
},
|
||||
{
|
||||
path: 'assessment/config',
|
||||
component: () => import('@/views/assessment/ExamConfig.vue'),
|
||||
meta: { title: '考核配置' }
|
||||
},
|
||||
{
|
||||
path: 'assessment/record',
|
||||
component: () => import('@/views/assessment/ExamRecord.vue'),
|
||||
meta: { title: '考核记录' }
|
||||
},
|
||||
|
||||
|
||||
// 订单管理(原有)
|
||||
{
|
||||
path: 'order/platform',
|
||||
component: () => import('@/views/order/PlatformOrder.vue'),
|
||||
meta: { title: '平台订单' }
|
||||
},
|
||||
{
|
||||
path: 'order/merchant',
|
||||
component: () => import('@/views/order/MerchantOrder.vue'),
|
||||
meta: { title: '商家订单' }
|
||||
},
|
||||
{
|
||||
path: 'order/detail/:id',
|
||||
component: () => import('@/views/order/Detail.vue'),
|
||||
meta: { title: '订单详情' }
|
||||
},
|
||||
// 跨平台管理(原有)
|
||||
{
|
||||
path: 'cross-order',
|
||||
component: () => import('@/views/cross-platform/Order.vue'),
|
||||
meta: { title: '跨平台订单' }
|
||||
},
|
||||
{
|
||||
path: 'cross-settings',
|
||||
component: () => import('@/views/cross-platform/Settings.vue'),
|
||||
meta: { title: '跨平台设置' }
|
||||
},
|
||||
{
|
||||
path: 'cross-data',
|
||||
component: () => import('@/views/cross-platform/Data.vue'),
|
||||
meta: { title: '跨平台数据' }
|
||||
},
|
||||
{
|
||||
path: 'cross-pre',
|
||||
component: () => import('@/views/cross-platform/Pre.vue'),
|
||||
meta: { title: '预结算处理' }
|
||||
},
|
||||
{
|
||||
path: 'cross-order/detail/:id',
|
||||
component: () => import('@/views/cross-platform/OrderDetail.vue'),
|
||||
meta: { title: '跨平台订单详情' }
|
||||
},
|
||||
// 用户管理(原有)
|
||||
{
|
||||
path: 'user/player',
|
||||
component: () => import('@/views/user/Player.vue'),
|
||||
meta: { title: '打手管理' }
|
||||
},
|
||||
{
|
||||
path: 'user/player/detail/:playerId',
|
||||
component: () => import('@/views/user/PlayerDetail.vue'),
|
||||
meta: { title: '打手详情' }
|
||||
},
|
||||
{
|
||||
path: 'user/guanli',
|
||||
component: () => import('@/views/user/Guanli.vue'),
|
||||
meta: { title: '管事管理' }
|
||||
},
|
||||
{
|
||||
path: 'user/guanli/detail/:id',
|
||||
component: () => import('@/views/user/GuanliDetail.vue'),
|
||||
meta: { title: '管事详情' }
|
||||
},
|
||||
{
|
||||
path: 'user/shangjia',
|
||||
component: () => import('@/views/user/Shangjia.vue'),
|
||||
meta: { title: '商家管理' }
|
||||
},
|
||||
{
|
||||
path: 'user/shangjia/detail/:id',
|
||||
component: () => import('@/views/user/ShangjiaDetail.vue'),
|
||||
meta: { title: '商家详情' }
|
||||
},
|
||||
{
|
||||
path: 'user/zuzhang',
|
||||
component: () => import('@/views/user/Zuzhang.vue'),
|
||||
meta: { title: '组长管理' }
|
||||
},
|
||||
{
|
||||
path: 'user/zuzhang/detail/:id',
|
||||
component: () => import('@/views/user/ZuzhangDetail.vue'),
|
||||
meta: { title: '组长详情' }
|
||||
},
|
||||
// 提现管理(原有)
|
||||
{
|
||||
path: 'withdraw/audit',
|
||||
component: () => import('@/views/withdraw/Audit.vue'),
|
||||
meta: { title: '提现审核' }
|
||||
},
|
||||
{
|
||||
path: 'withdraw/data',
|
||||
component: () => import('@/views/withdraw/Data.vue'),
|
||||
meta: { title: '提现数据' }
|
||||
},
|
||||
{
|
||||
path: 'withdraw/settings',
|
||||
component: () => import('@/views/withdraw/Settings.vue'),
|
||||
meta: { title: '提现设置' }
|
||||
},
|
||||
{
|
||||
path: 'withdraw/detail/:id',
|
||||
component: () => import('@/views/withdraw/Detail.vue'),
|
||||
meta: { title: '提现详情' }
|
||||
},
|
||||
// 管理员管理(原有)
|
||||
{
|
||||
path: 'admin/role',
|
||||
component: () => import('@/views/admin/Role.vue'),
|
||||
meta: { title: '角色管理' }
|
||||
},
|
||||
{
|
||||
path: 'admin/role/detail/:id',
|
||||
component: () => import('@/views/admin/RoleDetail.vue'),
|
||||
meta: { title: '角色详情' }
|
||||
},
|
||||
{
|
||||
path: 'admin/user',
|
||||
component: () => import('@/views/admin/AdminUser.vue'),
|
||||
meta: { title: '后台用户' }
|
||||
},
|
||||
{
|
||||
path: 'admin/user/detail/:id',
|
||||
component: () => import('@/views/admin/AdminUserDetail.vue'),
|
||||
meta: { title: '后台用户详情' }
|
||||
},
|
||||
// 处罚管理(原有)
|
||||
{
|
||||
path: 'punishment',
|
||||
component: () => import('@/views/Punishment.vue'),
|
||||
meta: { title: '处罚管理' }
|
||||
},
|
||||
{
|
||||
path: 'punishment/detail/:id',
|
||||
component: () => import('@/views/punishment/Detail.vue'),
|
||||
meta: { title: '处罚详情' }
|
||||
},
|
||||
|
||||
// ========== 商品管理(原有) ==========
|
||||
{
|
||||
path: 'product/list',
|
||||
component: () => import('@/views/product/List.vue'),
|
||||
meta: { title: '商品列表' }
|
||||
},
|
||||
{
|
||||
path: 'product/type-zone',
|
||||
component: () => import('@/views/product/TypeZone.vue'),
|
||||
meta: { title: '商品类型专区管理' }
|
||||
},
|
||||
{
|
||||
path: 'product/data',
|
||||
component: () => import('@/views/product/Data.vue'),
|
||||
meta: { title: '商品数据分析' }
|
||||
},
|
||||
{
|
||||
path: 'product/detail/:id',
|
||||
component: () => import('@/views/product/Detail.vue'),
|
||||
meta: { title: '商品详情' }
|
||||
},
|
||||
|
||||
// ========== 会员管理(原有) ==========
|
||||
{
|
||||
path: 'member/list',
|
||||
component: () => import('@/views/member/List.vue'),
|
||||
meta: { title: '会员管理' }
|
||||
},
|
||||
{
|
||||
path: 'member/data',
|
||||
component: () => import('@/views/member/Data.vue'),
|
||||
meta: { title: '会员数据分析' }
|
||||
},
|
||||
{
|
||||
path: 'miniapp/popup-notice',
|
||||
component: () => import('@/views/miniapp/PopupNotice.vue'),
|
||||
meta: { title: '弹窗公告管理' }
|
||||
},
|
||||
|
||||
|
||||
// ========== 🔥 新增:客服会话管理 ==========
|
||||
{
|
||||
path: 'chat/agent',
|
||||
component: () => import('@/views/chat/Agent.vue'),
|
||||
meta: { title: '会话管理' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes
|
||||
})
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const token = localStorage.getItem('token')
|
||||
if (to.path !== '/login' && !token) {
|
||||
next('/login')
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user