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

279 lines
9.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// +----------------------------------------------------------------------
// | 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';
/* 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'; // 系统设置
import fatePoolRouter from './modules/fatePool'; // 缘池
import wishTreeRouter from './modules/wishTree'; // 许愿树
/**
* 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
*
* 侧边栏导航顺序:
* 1. 数据监控 - 实时监控
* 2. 用户管理 - 用户、会员、等级、魅力值、认证、黑名单
* 3. 直播管理 - 房间、家族、粉丝团
* 4. 社交互动 - 好友、关注、通话、会话、聊天、评论、动态、互动
* 5. 礼物打赏 - 礼物、礼物数量、打赏记录
* 6. 虚拟道具 - 坐骑、头饰
* 7. 营销活动 - 平台活动、抽奖、营销、邀请、夫妻相
* 8. 任务系统 - 任务、新手任务
* 9. 财务管理 - 财务、提现、兑换、明细、配置
* 10. 订单商城 - 商品、订单、分销
* 11. 内容管理 - 内容、轮播图、系统消息、帮助中心
* 12. 用户反馈 - 举报反馈、申诉
* 13. 代理管理 - 代理、社会管理
* 14. 系统设置 - 设置、应用、配置、装修、移动端、版本、敏感词、验证码、维护
*/
export const constantRoutes = [
// 1. 数据监控
monitorRouter,
// 2. 用户管理
userManageRouter,
// 3. 直播管理
liveManageRouter,
// 4. 社交互动
socialManageRouter,
// 4.5 缘池
fatePoolRouter,
// 4.6 许愿树
wishTreeRouter,
// 5. 礼物打赏
giftManageRouter,
// 6. 虚拟道具
virtualPropsRouter,
// 7. 营销活动
activityManageRouter,
// 8. 任务系统
taskManageRouter,
// 9. 财务管理
financeManageRouter,
// 10. 订单商城
shopManageRouter,
// 11. 内容管理
contentManageRouter,
// 12. 用户反馈
feedbackManageRouter,
// 13. 代理管理
agentManageRouter,
// 14. 系统设置
systemSettingRouter,
// 系统页面
{
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 },
},
],
},
// 首页路由别名 - 兼容数据库菜单配置的 /home 路径
{
path: '/home',
component: Layout,
redirect: '/home/index',
hidden: true,
children: [
{
path: 'index',
component: () => import('@/views/dashboard/index'),
name: 'Home',
meta: { title: '首页', icon: 'el-icon-s-home', isAffix: true },
},
],
},
{
path: '/setting/uploadPicture',
component: () => import('@/components/uploadPicture/index.vue'),
name: 'uploadPicture',
},
// 移动端相关页面(隐藏)
{
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: '修改密码' },
},
],
},
// 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;