123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868 |
- import Vue from 'vue'
- import Router from 'vue-router'
- Vue.use(Router)
- /* Layout */
- import Layout from '@/layout'
- /**
- * Note: 路由配置项
- *
- * hidden: true // 当设置 true 的时候该路由不会再侧边栏出现 如401,login等页面,或者如一些编辑页面/edit/1
- * alwaysShow: true // 当你一个路由下面的 children 声明的路由大于1个时,自动会变成嵌套的模式--如组件页面
- * // 只有一个时,会将那个子路由当做根路由显示在侧边栏--如引导页面
- * // 若你想不管路由下面的 children 声明的个数都显示你的根路由
- * // 你可以设置 alwaysShow: true,这样它就会忽略之前定义的规则,一直显示根路由
- * redirect: noRedirect // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
- * name:'router-name' // 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
- * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
- * roles: ['admin', 'common'] // 访问路由的角色权限
- * permissions: ['a:a:a', 'b:b:b'] // 访问路由的菜单权限
- * meta : {
- noCache: true // 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
- title: 'title' // 设置该路由在侧边栏和面包屑中展示的名字
- icon: 'svg-name' // 设置该路由的图标,对应路径src/assets/icons/svg
- breadcrumb: false // 如果设置为false,则不会在breadcrumb面包屑中显示
- activeMenu: '/system/user' // 当路由设置了该属性,则会高亮相对应的侧边栏。
- }
- */
- // 公共路由
- export const constantRoutes = [{
- path: '/redirect',
- component: Layout,
- hidden: true,
- children: [{
- path: '/redirect/:path(.*)',
- component: () => import('@/views/redirect')
- }]
- },
- {
- path: '/login',
- component: () => import('@/views/login'),
- hidden: true
- },
- {
- path: '/register',
- component: () => import('@/views/register'),
- hidden: true
- },
- {
- path: '/404',
- component: () => import('@/views/error/404'),
- hidden: true
- },
- {
- path: '/401',
- component: () => import('@/views/error/401'),
- hidden: true
- },
- {
- path: '',
- component: Layout,
- redirect: 'index',
- children: [{
- path: 'index',
- component: () => import('@/views/index'),
- name: 'Index',
- meta: {
- title: '首页',
- icon: 'home',
- affix: true
- }
- }]
- },
- {
- path: '/user',
- component: Layout,
- hidden: true,
- redirect: 'noredirect',
- children: [{
- path: 'profile',
- component: () => import('@/views/system/user/profile/index'),
- name: 'Profile',
- meta: {
- title: '个人中心',
- icon: 'user'
- }
- }]
- }
- ]
- // 动态路由,基于用户权限动态去加载
- export const dynamicRoutes = [
- //****************** 内容管理 *******************//
- // 视频管理
- {
- path: '/content',
- name: "videoIndex",
- component: Layout,
- hidden: true,
- permissions: ['content:video:list'],
- name: 'videoList',
- children: [{
- path: 'video/detail',
- component: () => import('@/views/content/video/detail'),
- name: 'videoDetail',
- meta: {
- title: '视频详情',
- activeMenu: '/content/video'
- }
- }]
- },
- // 文章管理
- {
- path: '/content',
- name: 'articleIndex',
- component: Layout,
- hidden: true,
- permissions: ['content:articleList:list'],
- children: [{
- path: 'articleList/detail',
- component: () => import('@/views/content/article/detail'),
- name: 'articleDetail',
- meta: {
- title: '文章详情',
- activeMenu: '/content/articleList'
- }
- }]
- },
- //****************** 设备管理 *******************//
- // 设备列表
- {
- path: '/device',
- name: "deviceList",
- component: Layout,
- hidden: true,
- permissions: ['device:list:list'],
- children: [{
- path: 'deviceList/detail',
- component: () => import('@/views/device/list/detail'),
- name: 'deviceListDetail',
- meta: {
- title: '设备详情',
- activeMenu: '/device/deviceList'
- }
- }]
- },
- ///设备大类
- {
- path: '/device',
- name: "deviceClass",
- component: Layout,
- hidden: true,
- permissions: ['device:class:list'],
- name: 'class',
- children: [{
- path: 'class/detail',
- name: 'deviceClassDetail',
- component: () => import('@/views/device/class/detail'),
- meta: {
- title: '大类详情',
- activeMenu: '/device/class'
- }
- }]
- },
- // 设备升级
- {
- path: '/device',
- name: 'deviceVersion',
- component: Layout,
- hidden: true,
- permissions: ['device:version:list'],
- children: [{
- path: 'version/detail',
- name: 'deviceVersionDetail',
- component: () => import('@/views/device/version/detail'),
- meta: {
- title: '设备升级详情',
- activeMenu: '/device/version'
- }
- }]
- },
- {
- path: '/system/user-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:user:edit'],
- children: [{
- path: 'role/:userId(\\d+)',
- component: () => import('@/views/system/user/authRole'),
- name: 'AuthRole',
- meta: {
- title: '分配角色',
- activeMenu: '/system/user'
- }
- }]
- },
- {
- path: '/system/role-auth',
- component: Layout,
- hidden: true,
- permissions: ['system:role:edit'],
- children: [{
- path: 'user/:roleId(\\d+)',
- component: () => import('@/views/system/role/authUser'),
- name: 'AuthUser',
- meta: {
- title: '分配用户',
- activeMenu: '/system/role'
- }
- }]
- },
- {
- path: '/system/dict-data',
- component: Layout,
- hidden: true,
- permissions: ['system:dict:list'],
- children: [{
- path: 'index/:dictId(\\d+)',
- component: () => import('@/views/system/dict/data'),
- name: 'Data',
- meta: {
- title: '字典数据',
- activeMenu: '/system/dict'
- }
- }]
- },
- {
- path: '/monitor/job-log',
- component: Layout,
- hidden: true,
- permissions: ['monitor:job:list'],
- children: [{
- path: 'index',
- component: () => import('@/views/monitor/job/log'),
- name: 'JobLog',
- meta: {
- title: '调度日志',
- activeMenu: '/monitor/job'
- }
- }]
- },
- {
- path: '/tool/gen-edit',
- component: Layout,
- hidden: true,
- permissions: ['tool:gen:edit'],
- children: [{
- path: 'index/:tableId(\\d+)',
- component: () => import('@/views/tool/gen/editTable'),
- name: 'GenEdit',
- meta: {
- title: '修改生成配置',
- activeMenu: '/tool/gen'
- }
- }]
- },
- // 服务管理-VIP套餐
- {
- path: '/service',
- component: Layout,
- hidden: true,
- permissions: ['service:vip:list'],
- children: [{
- path: 'vip/detail',
- component: () => import('@/views/service/vip/detail'),
- name: 'vipDetail',
- meta: {
- title: '套餐详情',
- activeMenu: '/service/vipPackage'
- }
- }]
- },
- // 设备文章
- {
- path: '/device',
- component: Layout,
- hidden: true,
- permissions: ['device:article:list'],
- name: 'article',
- children: [{
- path: 'article/detail',
- component: () => import('@/views/device/article/detail'),
- name: 'devArticleDetail',
- meta: {
- title: '文章详情',
- activeMenu: '/device/article'
- }
- }]
- },
- // 音频管理
- // 歌手
- {
- path: "/music",
- component: Layout,
- hidden: true,
- permissions: ['music:singer:list'],
- name: 'singer',
- children: [{
- path: 'singer/detail',
- component: () => import('@/views/music/singer/detail'),
- name: 'musicSingerDetail',
- meta: {
- title: `歌手详情`,
- activeMenu: '/music/singer'
- }
- }]
- },
- // 歌曲
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:list:list'],
- name: 'musicList',
- children: [{
- path: 'musicList/detail',
- component: () => import('@/views/music/list/detail'),
- name: 'musicListDetail',
- meta: {
- title: `歌曲详情`,
- activeMenu: '/music/musicList'
- }
- }]
- },
- // 歌单
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:menu:list'],
- name: 'musicMenu',
- children: [{
- path: 'menu/detail',
- component: () => import('@/views/music/menu/detail'),
- name: 'menu',
- meta: {
- title: `歌单详情`,
- activeMenu: '/music/musicMenu'
- }
- }]
- },
- // 音乐专辑
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:album:list'],
- name: 'album',
- children: [{
- path: 'album/detail',
- component: () => import('@/views/music/album/detail'),
- name: 'albumDetail',
- meta: {
- title: '专辑详情',
- activeMenu: '/music/album'
- }
- }]
- },
- // 播客专辑
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:blog:list'],
- name: 'blog',
- children: [{
- path: 'blog/detail',
- component: () => import('@/views/music/blog/detail'),
- name: 'blogDetail',
- meta: {
- title: `播客详情`,
- activeMenu: '/music/blog'
- }
- }]
- },
- // 节目
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:program:list'],
- name: 'program',
- children: [{
- path: 'program/detail',
- component: () => import('@/views/music/program/detail'),
- name: 'programDetail',
- meta: {
- title: `节目详情`,
- activeMenu: '/music/program'
- }
- }]
- },
- // 主播
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:anchor:list'],
- name: 'anchor',
- children: [{
- path: 'anchor/detail',
- component: () => import('@/views/music/anchor/detail'),
- name: 'anchorDetail',
- meta: {
- title: '主播详情',
- activeMenu: '/music/anchor'
- }
- }]
- },
- // 广播电台
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:radio:list'],
- name: 'radio',
- children: [{
- path: 'radio/detail',
- component: () => import('@/views/music/radio/detail'),
- name: 'radioDetail',
- meta: {
- title: `电台详情`,
- activeMenu: '/music/radio'
- }
- }]
- },
- // 猫王精选电台
- {
- path: '/music',
- component: Layout,
- hidden: true,
- permissions: ['music:choiceness:list'],
- name: 'choiceness',
- children: [{
- path: 'choiceness/detail',
- component: () => import('@/views/music/choiceness/detail'),
- name: 'choicenessDetail',
- meta: {
- title: '猫王精选详情',
- activeMenu: '/music/choiceness'
- }
- }]
- },
- // 项目管理
- // 项目列表
- {
- path: '/project',
- component: Layout,
- hidden: true,
- permissions: ['project:list:list'],
- children: [{
- path: 'projectList/detail',
- component: () => import('@/views/project/list/detail'),
- name: 'projectListDetail',
- meta: {
- title: `项目详情`,
- activeMenu: '/project/projectList'
- }
- }]
- },
- // 运营管理
- // 启动页
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:startPage:list'],
- children: [{
- path: 'startPage/detail',
- component: () => import('@/views/operation/startPage/detail'),
- name: 'startPageDetail',
- meta: {
- title: '启动页详情',
- activeMenu: '/operation/startPage'
- }
- }]
- },
- // 说明书管理详情
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:explain:list'],
- children: [{
- path: 'explain/detail',
- component: () => import('@/views/operation/explain/detail'),
- name: 'explainDetail',
- meta: {
- title: '说明书管理详情',
- activeMenu: '/operation/explain'
- }
- }]
- },
- // 微信banner
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:wxbanner:list'],
- children: [{
- path: 'wxbanner/detail',
- component: () => import('@/views/operation/wxbanner/detail'),
- name: 'wxbannerDetail',
- meta: {
- title: '微信轮播图详情',
- activeMenu: '/operation/wxbanner'
- }
- }]
- },
- {
- path: '/push',
- component: Layout,
- hidden: true,
- permissions: ['push:update:list'],
- children: [{
- path: 'update/detail',
- component: () => import('@/views/push/update/detail'),
- name: 'updateDetail',
- meta: {
- title: '升级详情',
- activeMenu: '/push/update'
- }
- }]
- },
- // src/router/index.js
- // {
- // path: '/user',
- // component: Layout,
- // redirect: '/user/list',
- // name: 'User',
- // meta: { title: '用户管理', icon: 'user' },
- // children: [
- // {
- // path: 'list',
- // name: 'UserList',
- // component: () => import('@/views/system/user/User'),
- // meta: { title: '用户列表', noCache: true }
- // },
- // // 其他相关用户路由...
- // ]
- // },
- // 推荐管理
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:recommend:list'],
- children: [{
- path: 'homePage/recommend/detail',
- component: () => import('@/views/operation/recommend/detail'),
- name: 'recommendDetail',
- meta: {
- title: '推荐详情',
- activeMenu: '/operation/homePage/operationRecommend'
- }
- }]
- },
- // 定制频道
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:channel:list'],
- name: 'channel',
- children: [{
- path: 'channel/detail',
- component: () => import('@/views/operation/channel/detail'),
- name: 'channelDetail',
- meta: {
- title: `频道详情`,
- activeMenu: '/operation/channel'
- }
- }]
- },
- // 多频多台
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:channels:list'],
- name: 'channels',
- children: [{
- path: 'channels/detail',
- component: () => import('@/views/operation/channels/detail'),
- name: 'channelsDetail',
- meta: {
- title: `频道详情`,
- activeMenu: '/operation/channels'
- }
- }]
- },
- // 标签分类
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:tag:list'],
- name: 'tag',
- children: [{
- path: 'tag/detail',
- component: () => import('@/views/operation/tag/detail'),
- name: 'tagDetail',
- meta: {
- title: '标签详情',
- activeMenu: '/operation/tag'
- }
- }]
- },
- // 唤醒音
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:waken:list'],
- name: 'waken',
- children: [{
- path: 'waken/detail',
- component: () => import('@/views/operation/waken/detail'),
- name: 'wakenDetail',
- meta: {
- title: '唤醒音详情',
- activeMenu: '/operation/waken'
- }
- }]
- },
- // 场景专区
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:scene:list'],
- name: 'scene',
- children: [{
- path: 'scene/detail',
- component: () => import('@/views/operation/scene/detail'),
- name: 'sceneDetail',
- meta: {
- title: '场景专区详情',
- activeMenu: '/operation/scene'
- }
- }]
- },
- // 协议管理
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:agreement:list'],
- name: 'agreement',
- children: [{
- path: 'agreement/detail',
- component: () => import('@/views/operation/agreement/detail'),
- name: 'agreementDetail',
- meta: {
- title: '协议详情',
- activeMenu: '/operation/agreement'
- }
- }]
- },
- // 活动管理
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:activity:list'],
- name: 'activity',
- children: [{
- path: 'activity/detail',
- component: () => import('@/views/operation/activity/detail'),
- name: 'activityDetail',
- meta: {
- title: '活动详情',
- activeMenu: '/operation/activity'
- }
- }]
- },
- // 反馈列表
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:feedbacklist:list'],
- name: 'feedbacklist',
- children: [{
- path: 'feedback/feedbacklist/detail',
- component: () => import('@/views/operation/feedbacklist/detail'),
- name: 'feedbacklistDetail',
- meta: {
- title: '反馈详情',
- activeMenu: '/operation/feedback/feedbacklist'
- }
- }]
- },
- // 门店管理
- {
- path: '/operation',
- component: Layout,
- hidden: true,
- permissions: ['operation:map:list'],
- name: 'map',
- children: [{
- path: 'map/detail',
- component: () => import('@/views/operation/map/detail'),
- name: 'mapDetail',
- meta: {
- title: '门店详情',
- activeMenu: '/opertaion/map'
- }
- }]
- },
- // 商品管理
- // 商品推荐
- {
- path: '/goods',
- component: Layout,
- hidden: true,
- permissions: ['goods:list:list'],
- children: [{
- path: 'goodsList/detail',
- component: () => import('@/views/goods/list/detail'),
- name: 'goodsListDetail',
- meta: {
- title: '商品详情',
- activeMenu: '/goods/goodsList'
- }
- }]
- },
- // 服务管理
- // 音乐套餐 / 流量套餐
- {
- path: '/service',
- component: Layout,
- name: "musicPackage",
- hidden: true,
- permissions: ['service:package:list'],
- children: [{
- path: 'package/detail',
- component: () => import('@/views/service/package/detail'),
- name: 'packageDetail',
- meta: {
- title: '套餐详情'
- }
- }]
- },
- // 签到管理
- // 抽奖配置
- {
- path: '/registration',
- component: Layout,
- hidden: true,
- permissions: ['registration:lotteryConfig:list'],
- children: [{
- path: 'lotteryConfig/detail',
- component: () => import('@/views/registration/lottery/detail'),
- name: 'lotteryConfigDetail',
- meta: {
- title: '配置详情',
- activeMenu: '/registration/lotteryConfig'
- }
- }]
- },
- // 内容配置
- {
- path: '/registration',
- component: Layout,
- hidden: true,
- permissions: ['registration:contentConfig:list'],
- children: [{
- path: 'contentConfig/detail',
- component: () => import('@/views/registration/content/detail'),
- name: 'contentConfigDetail',
- meta: {
- title: '配置详情',
- activeMenu: '/registration/contentConfig'
- }
- }]
- },
- // 兑换配置
- {
- path: '/registration',
- component: Layout,
- hidden: true,
- permissions: ['registration:exchangeConfig:list'],
- children: [{
- path: 'exchangeConfig/detail',
- component: () => import('@/views/registration/exchange/detail'),
- name: 'exchangeConfigDetail',
- meta: {
- title: '配置详情',
- activeMenu: '/registration/exchangeConfig'
- }
- }]
- },
- // App升级
- {
- path: '/push',
- component: Layout,
- hidden: true,
- permissions: ['push:update:list'],
- children: [{
- path: 'update/detail',
- component: () => import('@/views/push/update/detail'),
- name: 'updateDetail',
- meta: {
- title: '升级详情',
- activeMenu: '/push/update'
- }
- }]
- },
- // 推送弹窗
- {
- path: '/push',
- component: Layout,
- hidden: true,
- permissions: ['push:dialog:list'],
- children: [{
- path: 'pushDialog/detail',
- component: () => import('@/views/push/dialog/detail'),
- name: 'dialogDetail',
- meta: {
- title: '弹窗详情',
- activeMenu: '/push/pushDialog'
- }
- }]
- }
- ]
- export default new Router({
- mode: 'history', // 去掉url中的#
- scrollBehavior: () => ({
- y: 0
- }),
- routes: constantRoutes
- })
|