123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793 |
- import Vue from 'vue'
- import Router from 'vue-router'
- Vue.use(Router)
- /* Layout */
- import Layout from '@/layout'
- /**
- * 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'/'el-icon-x' the icon show in the sidebar
- 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
- */
- // export const constantRoutes = [{
- // path: '/login',
- // component: () => import('@/views/login/index'),
- // hidden: true
- // },
- // {
- // path: '/404',
- // component: () => import('@/views/404'),
- // hidden: true
- // },
- // // 商家管理
- // {
- // path: '/',
- // component: Layout,
- // redirect: '/businessList',
- // meta: {
- // title: '商家管理',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'businessList',
- // name: 'businessList',
- // component: () => import('@/views/business/businessList/index'),
- // meta: {
- // title: '商家列表',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'settlement',
- // name: 'settlement',
- // component: () => import('@/views/business/settlement/index'),
- // meta: {
- // title: '入驻申请',
- // icon: 'tree'
- // }
- // },
- // {
- // hidden: true,
- // path: 'addSettlement',
- // name: 'addSettlement',
- // component: () => import('@/views/business/settlement/addSettlement'),
- // meta: {
- // title: '入驻申请详情',
- // icon: 'tree'
- // }
- // }
- // ]
- // },
- // // 平台装修
- // {
- // path: '/renovation',
- // component: Layout,
- // name: 'renovation',
- // meta: {
- // title: '平台装修',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'wechatApp',
- // name: 'wechatApp',
- // component: () => import('@/views/renovation/wechatApp/index'),
- // meta: {
- // title: '小程序',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'custom',
- // name: 'custom',
- // component: () => import('@/views/renovation/custom/index'),
- // meta: {
- // title: '自定义页面',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'commdityClass',
- // name: 'commdityClass',
- // component: () => import('@/views/renovation/commdityClass/index'),
- // meta: {
- // title: '商品类别',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'commoditySystem',
- // name: 'commoditySystem',
- // component: () => import('@/views/renovation/commoditySystem/index'),
- // meta: {
- // title: '商品管理',
- // icon: 'tree'
- // }
- // },
- // {
- // hidden: true, // (默认 false)
- // path: 'addCommodity',
- // name: 'addCommodity',
- // component: () => import('@/views/renovation/commoditySystem/addCommodity'),
- // meta: {
- // title: '查看详情',
- // icon: 'table'
- // }
- // }
- // ]
- // },
- // // 平台活动
- // {
- // path: '/active',
- // component: Layout,
- // redirect: '/active/seckilllist',
- // meta: {
- // title: '平台活动',
- // icon: 'el-icon-s-help'
- // },
- // children: [
- // // {
- // // path: '/active/index',
- // // name: 'active',
- // // component: () => import('@/views/active/index'),
- // // meta: {
- // // title: '平台活动',
- // // icon: 'dashboard'
- // // }
- // // },
- // // {
- // // hidden: true,
- // // path: '/active/add',
- // // name: 'addActive',
- // // component: () => import('@/views/active/addActive'),
- // // meta: {
- // // title: '新增活动',
- // // icon: 'dashboard'
- // // }
- // // },
- // // {
- // // hidden: true,
- // // path: '/active/activeDetails',
- // // name: 'activeDetails',
- // // component: () => import('@/views/active/activeDetails'),
- // // meta: {
- // // title: '活动详情',
- // // icon: 'dashboard'
- // // }
- // // },
- // {
- // path: '/active/couponlist',
- // name: 'couponlist',
- // component: () => import('@/views/active/coupon/index.vue'),
- // meta: {
- // title: '优惠券活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/couponlist/add',
- // name: 'couponlistAdd',
- // component: () => import('@/views/active/coupon/couponAdd.vue'),
- // meta: {
- // title: '新增优惠券活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/couponlist/couponDetail',
- // name: 'couponDetail',
- // component: () => import('@/views/active/coupon/couponDetail.vue'),
- // meta: {
- // title: '优惠券活动详情',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: '/active/seckilllist',
- // name: 'seckilllist',
- // component: () => import('@/views/active/seckill/index.vue'),
- // meta: {
- // title: '秒杀活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/seckilllist/add',
- // name: 'seckilllistAdd',
- // component: () => import('@/views/active/seckill/seckillAdd.vue'),
- // meta: {
- // title: '新增秒杀活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/seckilllist/seckillDetail',
- // name: 'seckillDetail',
- // component: () => import('@/views/active/seckill/seckillDetail.vue'),
- // meta: {
- // title: '秒杀活动详情',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: '/active/discountlist',
- // name: 'discountlist',
- // component: () => import('@/views/active/discount/index.vue'),
- // meta: {
- // title: '限时折扣',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/discount/add',
- // name: 'discountAdd',
- // component: () => import('@/views/active/discount/discountAdd.vue'),
- // meta: {
- // title: '新增折扣活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/discount/discountDetail',
- // name: 'discountDetail',
- // component: () => import('@/views/active/discount/discountDetail.vue'),
- // meta: {
- // title: '折扣活动详情',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: '/active/politelist',
- // name: 'politelist',
- // component: () => import('@/views/active/polite/index.vue'),
- // meta: {
- // title: '支付有礼',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/politelist/add',
- // name: 'politelistAdd',
- // component: () => import('@/views/active/polite/politeAdd.vue'),
- // meta: {
- // title: '新增支付有礼活动',
- // icon: 'dashboard'
- // }
- // },
- // {
- // hidden: true,
- // path: '/active/politelist/politeDetail',
- // name: 'politeDetail',
- // component: () => import('@/views/active/polite/politeDetail.vue'),
- // meta: {
- // title: '支付有礼活动详情',
- // icon: 'dashboard'
- // }
- // }
- // ]
- // },
- // // Redis延时任务
- // {
- // path: '/pay',
- // component: Layout,
- // children: [{
- // path: '/',
- // name: 'pay',
- // component: () => import('@/views/pay/index'),
- // meta: {
- // title: 'Redis延时任务',
- // icon: 'dashboard'
- // }
- // }]
- // },
- // // 财务
- // {
- // path: '/finance',
- // component: Layout,
- // meta: {
- // title: '财务',
- // icon: 'dashboard'
- // },
- // children: [{
- // path: 'withdrawal',
- // name: 'withdrawal',
- // component: () => import('@/views/finance/withdrawal/index'),
- // meta: {
- // title: '提现申请',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: 'overview',
- // name: 'overview',
- // component: () => import('@/views/finance/overview/index'),
- // meta: {
- // title: '财务概况',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: 'bond',
- // name: 'bond',
- // component: () => import('@/views/finance/bond/index'),
- // meta: {
- // title: '财务概况',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: 'application',
- // name: 'application',
- // component: () => import('@/views/finance/application/index'),
- // meta: {
- // title: '用户提现申请',
- // icon: 'dashboard'
- // }
- // }
- // ]
- // },
- // // {
- // // path: '/after',
- // // component: Layout,
- // // children: [{
- // // path: 'after',
- // // name: 'after',
- // // component: () => import('@/views/after/index'),
- // // meta: {
- // // title: '售后处理',
- // // icon: 'dashboard'
- // // }
- // // },
- // // {
- // // path: 'afterDetails',
- // // name: 'afterDetails',
- // // component: () => import('@/views/after/details'),
- // // meta: {
- // // title: '售后详情',
- // // icon: 'dashboard'
- // // }
- // // }
- // // ]
- // // },
- // // 订单
- // {
- // path: '/order',
- // component: Layout,
- // redirect: '/order',
- // name: 'order',
- // meta: {
- // title: '订单',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'pending',
- // name: 'pending',
- // component: () => import('@/views/order/pending/index'),
- // meta: {
- // title: '待处理订单',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'after',
- // name: 'after',
- // component: () => import('@/views/order/after/index'),
- // meta: {
- // title: '售后处理',
- // icon: 'dashboard'
- // }
- // },
- // {
- // path: 'afterDetails',
- // name: 'afterDetails',
- // component: () => import('@/views/order/after/details'),
- // meta: {
- // title: '售后详情',
- // icon: 'dashboard'
- // }
- // }
- // ]
- // },
- // // {
- // // path: '/system',
- // // component: Layout,
- // // children: [{
- // // hidden: true, // (默认 false)
- // // path: '/system/editShopSys',
- // // component: () => import('@/views/system/shopSys/edit'), // Parent router-view
- // // name: 'editShopSys',
- // // meta: {
- // // title: '编辑店铺信息'
- // // },
- // // },
- // // {
- // // path: '/system/shopSys',
- // // component: () => import('@/views/system/shopSys/index'), // Parent router-view
- // // name: 'dict',
- // // meta: {
- // // title: '店铺设置',
- // // icon: 'dashboard'
- // // },
- // // },
- // // ]
- // // },
- // // 评论
- // {
- // path: '/comment',
- // component: Layout,
- // redirect: '/comment/commentSys',
- // name: 'comment',
- // meta: {
- // title: '评论',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'commentSys',
- // name: 'commentSys',
- // component: () => import('@/views/comment/commentSys/index'),
- // meta: {
- // title: '评论管理',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'sensitive',
- // name: 'sensitive',
- // component: () => import('@/views/comment/sensitive/index'),
- // meta: {
- // title: '敏感词管理',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'keyWord',
- // name: 'keyWord',
- // component: () => import('@/views/comment/keyword/index'),
- // meta: {
- // title: '关键词管理',
- // icon: 'tree'
- // }
- // }
- // ]
- // },
- // // 客户管理
- // {
- // path: '/customer',
- // component: Layout,
- // redirect: '/customer/customerMage',
- // name: 'customer',
- // meta: {
- // title: '客户管理',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'customerMage',
- // name: 'customerMage',
- // component: () => import('@/views/customer/customerMage/index'),
- // meta: {
- // title: '客户管理',
- // icon: 'table'
- // }
- // },
- // {
- // hidden: true,
- // path: 'customerDetails',
- // name: 'customerDetails',
- // component: () => import('@/views/customer/customerMage/customerDetails'),
- // meta: {
- // title: '客户详情',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'tips',
- // name: 'tips',
- // component: () => import('@/views/customer/tips/index'),
- // meta: {
- // title: '标签管理',
- // icon: 'tree'
- // }
- // },
- // {
- // hidden: true,
- // path: 'addTips',
- // name: 'addTips',
- // component: () => import('@/views/customer/tips/addTips'),
- // meta: {
- // title: '创建标签',
- // icon: 'tree'
- // }
- // }
- // ]
- // },
- // // 系统管理
- // {
- // path: '/setup',
- // component: Layout,
- // redirect: '/setup/user',
- // name: 'setup',
- // meta: {
- // title: '系统管理',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'user',
- // name: 'user',
- // component: () => import('@/views/setup/user/index'),
- // meta: {
- // title: '用户管理',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'role',
- // name: 'role',
- // component: () => import('@/views/setup/role/index'),
- // meta: {
- // title: '角色管理',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'tabs',
- // name: 'tabs',
- // component: () => import('@/views/setup/tabs/index'),
- // meta: {
- // title: '菜单管理',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'businessMenus',
- // name: 'businessMenus',
- // component: () => import('@/views/setup/businessMenus/index'),
- // meta: {
- // title: '商家菜单',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'dict',
- // name: 'dict',
- // component: () => import('@/views/setup/dict/index'),
- // meta: {
- // title: '字典管理',
- // icon: 'tree'
- // }
- // }
- // ]
- // },
- // // 消息中心
- // {
- // path: '/notice',
- // component: Layout,
- // redirect: '/notice/history',
- // name: 'notice',
- // meta: {
- // title: '消息中心',
- // icon: 'el-icon-chat-square'
- // },
- // children: [{
- // path: 'history',
- // name: 'history',
- // component: () => import('@/views/notice/history'),
- // meta: {
- // title: '历史消息',
- // icon: 'el-icon-chat-dot-square'
- // }
- // },
- // {
- // path: 'push',
- // name: 'push',
- // component: () => import('@/views/notice/push'),
- // meta: {
- // title: '消息推送',
- // icon: 'el-icon-chat-line-square'
- // }
- // }
- // ]
- // },
- // // 会员中心
- // {
- // path: '/member',
- // component: Layout,
- // redirect: '/member/memberList',
- // name: 'member',
- // meta: {
- // title: '会员管理',
- // icon: 'el-icon-s-help'
- // },
- // children: [{
- // path: 'memberList',
- // name: 'memberList',
- // component: () => import('@/views/member/memberList/index'),
- // meta: {
- // title: '会员管理',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'equity',
- // name: 'equity',
- // component: () => import('@/views/member/equity/index'),
- // meta: {
- // title: '会员权益',
- // icon: 'table'
- // }
- // },
- // {
- // hidden: true,
- // path: 'customerDetails',
- // name: 'customerDetails',
- // component: () => import('@/views/member/customerMage/customerDetails'),
- // meta: {
- // title: '会员详情',
- // icon: 'table'
- // }
- // },
- // {
- // path: 'tips',
- // name: 'tips',
- // component: () => import('@/views/member/tips/index'),
- // meta: {
- // title: '标签管理',
- // icon: 'tree'
- // }
- // },
- // {
- // path: 'levelList',
- // name: 'levelList',
- // component: () => import('@/views/member/levelList/index'),
- // meta: {
- // title: '会员等级',
- // icon: 'tree'
- // }
- // },
- // {
- // hidden: true,
- // path: 'addTips',
- // name: 'addTips',
- // component: () => import('@/views/member/tips/addTips'),
- // meta: {
- // title: '创建标签',
- // icon: 'tree'
- // }
- // }
- // ]
- // },
- // // 直播管理
- // {
- // path: '/liveMenu',
- // component: Layout,
- // redirect: '/member/memberList',
- // name: 'liveMenu',
- // meta: {
- // title: '直播管理',
- // icon: 'el-icon-s-help'
- // },
- // children: [
- // {
- // path: '/liveMenu/liveRoom',
- // name: 'liveRoom',
- // component: () => import('@/views/liveMenu/liveRoom/index.vue'),
- // meta: {
- // title: '直播间管理',
- // icon: 'table'
- // }
- // },
- // {
- // path: '/liveMenu/liveProduct',
- // name: 'liveProduct',
- // component: () => import('@/views/liveMenu/liveProduct/index.vue'),
- // meta: {
- // title: '直播商品管理',
- // icon: 'tree'
- // }
- // }
- // ]
- // }
- // // 404 page must be placed at the end !!!
- // // {
- // // path: '*',
- // // redirect: '/404',
- // // hidden: true
- // // }
- // ]
- export const mainRoutes = [
- {
- path: '/login',
- component: () => import('@/views/login/index'),
- hidden: true
- },
- {
- path: '/404',
- component: () => import('@/views/404'),
- hidden: true
- },
- {
- path: '/',
- component: Layout,
- redirect: '/dashboard',
- meta: {
- title: '总览',
- icon: 'el-icon-monitor'
- },
- children: [ {
- path: 'dashboard',
- name: 'dashboard',
- component: () => import('@/views/dashboard/index.vue'),
- meta: {
- title: '总览',
- icon: 'el-icon-monitor'
- }
- } ]
- }
- // {
- // path: '/marketingManagement',
- // component: Layout,
- // redirect: '/marketingManagement/voucher',
- // resourceType: 'catalog',
- // alwaysShow: true, // 这个代表为目录
- // meta: {
- // title: '营销管理',
- // icon: 'el-icon-monitor'
- // },
- // children: [ {
- // path: 'voucher',
- // name: 'voucher',
- // component: () => import('@/views/marketingManagement/voucher/index.vue'),
- // meta: {
- // title: '代金卷管理',
- // icon: 'el-icon-monitor'
- // }
- // } ]
- // }
- ]
- const createRouter = () => new Router({
- // mode: 'history', // require service support
- scrollBehavior: () => ({
- y: 0
- }),
- // routes: constantRoutes
- routes: mainRoutes
- })
- 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
|