123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195 |
- import Vue from 'vue'
- import Router from 'vue-router'
- Vue.use(Router)
- /* Layout */
- import Layout from '@/layout'
- /**
- * 参照: https://panjiachen.github.io/vue-element-admin-site/zh/guide/essentials/router-and-nav.html
- *
- * hidden: true 设置为true不会出现在侧边栏默认false
- * alwaysShow: true 设为true变成下拉菜单
- * redirect: noRedirect 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
- * name:'router-name' 设定路由的名字,一定要填写不然使用<keep-alive>时会出现各种问题
- * meta : {
- roles: ['admin','editor'] 设置该路由进入的权限,支持多个权限叠加
- title: 'title' 设置该路由在侧边栏和面包屑中展示的名字
- icon: 'svg-name' 设置该路由的图标
- breadcrumb: false 如果设置为true,则不会被 <keep-alive> 缓存(默认 false)
- activeMenu: '/example/list' 如果设置为false,则不会在breadcrumb面包屑中显示
- }
- */
- export const constantRoutes = [
- {
- path: '/login',
- component: () => import('@/views/login/index'),
- hidden: true
- },
- {
- path: '/404',
- component: () => import('@/views/404'),
- hidden: true
- },
- {
- path: '/',
- component: Layout,
- redirect: '/dashboard',
- children: [{
- path: 'dashboard',
- name: 'Dashboard',
- component: () => import('@/views/dashboard/index'),
- meta: { title: '首页', icon: 'dashboard', affix: true }
- }]
- },
- {
- path: '/schoolTimetable',
- component: Layout,
- redirect: '/schoolTimetable',
- children: [{
- path: 'schoolTimetable',
- name: 'SchoolTimetable',
- component: () => import('@/views/schoolTimetable/index'),
- meta: { title: '课程表', icon: 'dashboard' }
- }]
- },
- {
- path: '/dashboardBlockRow',
- component: Layout,
- redirect: '/dashboardBlockRow',
- children: [{
- path: 'dashboardBlockRow',
- name: 'DashboardBlockRow',
- component: () => import('@/views/dashboardBlockRow/index'),
- meta: { title: '首页行管理' }
- }],
- hidden: true
- },
- {
- path: '/dashboardRowItem',
- component: Layout,
- redirect: '/dashboardRowItem',
- children: [{
- path: 'dashboardRowItem',
- name: 'DashboardRowItem',
- component: () => import('@/views/dashboardRowItem/index'),
- meta: { title: '首页项列表' }
- }],
- hidden: true
- },
- {
- path: '/tempateList',
- component: Layout,
- redirect: '/tempateList',
- children: [{
- path: 'tempateList',
- name: 'TempateList',
- component: () => import('@/views/tempateList/index'),
- meta: { title: '模板列表', icon: 'dashboard' }
- }]
- },
- {
- path: '/uploadTab',
- component: Layout,
- redirect: '/uploadTab',
- children: [{
- path: 'uploadTab',
- name: 'UploadTab',
- component: () => import('@/views/uploadTab/index'),
- meta: { title: '导入表格' }
- }],
- hidden: true
- },
- {
- path: '/schoolDetail',
- component: Layout,
- redirect: '/schoolDetail',
- children: [{
- path: 'schoolDetail',
- name: 'SchoolDetail',
- component: () => import('@/views/schoolDetail/index'),
- meta: { title: '课程表详情' }
- }],
- hidden: true
- },
- {
- path: '/categoryList',
- component: Layout,
- redirect: '/categoryList',
- children: [{
- path: 'categoryList',
- name: 'CategoryList',
- component: () => import('@/views/categoryList/index'),
- meta: { title: '专区列表', icon: 'dashboard' }
- }]
- },
- {
- path: '/categoryRelation',
- component: Layout,
- redirect: '/categoryRelation',
- children: [{
- path: 'categoryRelation',
- name: 'CategoryRelation',
- component: () => import('@/views/categoryRelation/index'),
- meta: { title: '专区课程列表' }
- }],
- hidden: true
- },
- {
- path: '/memberList',
- component: Layout,
- redirect: '/memberList',
- children: [{
- path: 'memberList',
- name: 'MemberList',
- component: () => import('@/views/memberList/index'),
- meta: { title: '用户列表', icon: 'dashboard' }
- }]
- },
- {
- path: '/memberOrder',
- component: Layout,
- redirect: '/memberOrder',
- children: [{
- path: 'memberOrder',
- name: 'MemberOrder',
- component: () => import('@/views/memberOrder/index'),
- meta: { title: '用户订单' }
- }],
- hidden: true
- },
- {
- path: '/memberAuth',
- component: Layout,
- redirect: '/memberAuth',
- children: [{
- path: 'memberAuth',
- name: 'MemberAuth',
- component: () => import('@/views/memberAuth/index'),
- meta: { title: '用户权限' }
- }],
- hidden: true
- },
- // 404 page must be placed at the end !!!
- { path: '*', redirect: '/404', hidden: true }
- ]
- const createRouter = () => new Router({
- // mode: 'history', // require service support
- 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
|