zhibo/Zhibo/admin/src/router/index.js

258 lines
8.5 KiB
JavaScript
Raw Normal View History

2025-12-21 16:08:52 +08:00
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
import Vue from 'vue';
import Router from 'vue-router';
Vue.use(Router);
/* Layout */
import Layout from '@/layout';
2025-12-29 14:56:26 +08:00
/* Router Modules - 整合后的路由模块 */
import monitorRouter from './modules/monitor'; // 数据监控
import userManageRouter from './modules/userManage'; // 用户管理
import liveManageRouter from './modules/liveManage'; // 直播管理
import socialManageRouter from './modules/socialManage'; // 社交互动
import giftManageRouter from './modules/giftManage'; // 礼物打赏
import virtualPropsRouter from './modules/virtualProps'; // 虚拟道具
import activityManageRouter from './modules/activityManage'; // 营销活动
import taskManageRouter from './modules/taskManage'; // 任务系统
import financeManageRouter from './modules/financeManage'; // 财务管理
import shopManageRouter from './modules/shopManage'; // 订单商城
import contentManageRouter from './modules/contentManage'; // 内容管理
import feedbackManageRouter from './modules/feedbackManage'; // 用户反馈
import agentManageRouter from './modules/agentManage'; // 代理管理
import systemSettingRouter from './modules/systemSetting'; // 系统设置
2025-12-21 16:08:52 +08:00
/**
* Note: sub-menu only appear when route children.length >= 1
* Detail see: https://panjiachen.github.io/vue-element-admin-site/guide/essentials/router-and-nav.html
*
* hidden: true if set true, item will not show in the sidebar(default is false)
* alwaysShow: true if set true, will always show the root menu
* if not set alwaysShow, when item has more than one children route,
* it will becomes nested mode, otherwise not show the root menu
* redirect: noRedirect if set noRedirect will no redirect in the breadcrumb
* name:'router-name' the name is used by <keep-alive> (must set!!!)
* meta : {
roles: ['admin','editor'] control the page roles (you can set multiple roles)
title: 'title' the name show in sidebar and breadcrumb (recommend set)
icon: 'svg-name' the icon show in the sidebar
noCache: true if set true, the page will no be cached(default is false)
affix: true if set true, the tag will affix in the tags-view
breadcrumb: false if set false, the item will hidden in breadcrumb(default is true)
activeMenu: '/example/list' if set path, the sidebar will highlight the path you set
}
*/
/**
* constantRoutes
* a base page that does not have permission requirements
* all roles can be accessed
*
2025-12-29 14:56:26 +08:00
* 侧边栏导航顺序
* 1. 数据监控 - 实时监控
* 2. 用户管理 - 用户会员等级魅力值认证黑名单
* 3. 直播管理 - 房间家族粉丝团
* 4. 社交互动 - 好友关注通话会话聊天评论动态互动
* 5. 礼物打赏 - 礼物礼物数量打赏记录
* 6. 虚拟道具 - 坐骑头饰
* 7. 营销活动 - 平台活动抽奖营销邀请夫妻相
* 8. 任务系统 - 任务新手任务
* 9. 财务管理 - 财务提现兑换明细配置
* 10. 订单商城 - 商品订单分销
* 11. 内容管理 - 内容轮播图系统消息帮助中心
* 12. 用户反馈 - 举报反馈申诉
* 13. 代理管理 - 代理社会管理
* 14. 系统设置 - 设置应用配置装修移动端版本敏感词验证码维护
2025-12-21 16:08:52 +08:00
*/
export const constantRoutes = [
2025-12-29 14:56:26 +08:00
// 1. 数据监控
monitorRouter,
// 2. 用户管理
userManageRouter,
// 3. 直播管理
liveManageRouter,
// 4. 社交互动
socialManageRouter,
// 5. 礼物打赏
giftManageRouter,
// 6. 虚拟道具
virtualPropsRouter,
// 7. 营销活动
activityManageRouter,
// 8. 任务系统
taskManageRouter,
// 9. 财务管理
financeManageRouter,
// 10. 订单商城
shopManageRouter,
// 11. 内容管理
contentManageRouter,
// 12. 用户反馈
feedbackManageRouter,
// 13. 代理管理
agentManageRouter,
// 14. 系统设置
systemSettingRouter,
// 系统页面
2025-12-21 16:08:52 +08:00
{
path: '/404',
component: () => import('@/views/error-page/404'),
hidden: true,
},
{
path: '/page/design/creatDevise/:id?/:type?',
component: () => import('@/views/design/devise/creatDevise'),
hidden: true,
},
{
path: '/redirect',
component: Layout,
hidden: true,
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index'),
},
],
},
{
path: '/auth-send',
component: () => import('@/views/mobile/auth-send'),
hidden: true,
},
{
path: '/login',
component: () => import('@/views/login/index'),
hidden: true,
},
{
path: '/auth-redirect',
component: () => import('@/views/login/auth-redirect'),
hidden: true,
},
{
path: '/401',
component: () => import('@/views/error-page/401'),
hidden: true,
},
{
path: '/',
component: Layout,
redirect: '/dashboard',
children: [
{
path: '/dashboard',
component: () => import('@/views/dashboard/index'),
name: 'Dashboard',
meta: { title: '主页', icon: 'dashboard', isAffix: true },
},
],
},
{
path: '/setting/uploadPicture',
component: () => import('@/components/uploadPicture/index.vue'),
name: 'uploadPicture',
},
2025-12-29 14:56:26 +08:00
// 移动端相关页面(隐藏)
{
path: '/javaMobile',
component: Layout,
hidden: true,
children: [
{
path: 'orderCancellation',
component: () => import('@/views/mobile/orderCancellation/index.vue'),
name: 'OrderCancellation',
meta: { title: '订单核销' },
},
{
path: 'orderStatistics',
component: () => import('@/views/mobile/orderStatistics/index.vue'),
name: 'OrderStatistics',
meta: { title: '订单统计' },
},
{
path: 'orderList/:types?',
component: () => import('@/views/mobile/orderStatistics/orderList.vue'),
name: 'OrderList',
meta: { title: '订单列表' },
},
{
path: 'orderDelivery/:oid/:id?',
component: () => import('@/views/mobile/orderStatistics/orderDelivery.vue'),
name: 'OrderDelivery',
meta: { title: '订单发货' },
},
{
path: 'orderDetail/:id?/:goname?',
component: () => import('@/views/mobile/orderStatistics/orderDetail.vue'),
name: 'OrderDetail',
meta: { title: '订单详情' },
},
{
path: 'orderStatisticsDetail/:type/:time?',
component: () => import('@/views/mobile/orderStatistics/Statistics.vue'),
name: 'OrderStatisticsDetail',
meta: { title: '订单数据统计' },
},
],
},
// 个人中心(隐藏)
{
path: '/maintain',
component: Layout,
hidden: true,
children: [
{
path: 'user',
component: () => import('@/views/maintain/user'),
name: 'MaintainUser',
meta: { title: '个人中心' },
},
{
path: 'update',
component: () => import('@/views/maintain/user/update'),
name: 'MaintainUpdate',
meta: { title: '修改密码' },
},
],
},
2025-12-21 16:08:52 +08:00
// 404 page must be placed at the end !!!
{ path: '*', redirect: '/404', hidden: true },
];
/**
* asyncRoutes
* the routes that need to be dynamically loaded based on user roles
*/
export const asyncRoutes = [];
const createRouter = () =>
new Router({
// mode: 'history', // require service support
mode: 'history',
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes,
});
const router = createRouter();
// Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465
export function resetRouter() {
const newRouter = createRouter();
router.matcher = newRouter.matcher; // reset router
}
export default router;