text: import Vue from 'vue'
  import Router from 'vue-router'
  
  Vue.use(Router)
  
  /* Layout */
  import Layout from '@/layout'
  
  export const constantRoutes = [
    // 登录
    {
      path: '/login',
      component: () => import('@/views/login/index'),
      hidden: true
    },
    // 未找到页面
    {
      path: '/404',
      component: () => import('@/views/404'),
      hidden: true
    },
    // 系统架构
    {
      path: '/systemArchitecture',
      component: Layout,
      redirect: '/systemArchitecture/depManage',
      name: 'SystemArchitecture',
      meta: {
        title: '系统架构',
        icon: 'nested'
      },
      children: [
        {
          path: 'depManage',
          component: () => import('@/views/systemArchitecture/depManage/index'),
          name: 'DepManage',
          meta: { title: '部门管理' }
        },
        {
          path: 'roleManage',
          component: () => import('@/views/systemArchitecture/roleManage/index'),
          name: 'RoleManage',
          meta: { title: '角色管理' }
        }
      ]
    },
    // 用户管理
    {
      path: '/',
      component: Layout,
      redirect: '/userManage',
      children: [{
        path: 'userManage',
        name: 'UserManage',
        component: () => import('@/views/userManage/index'),
        meta: { title: '用户管理', icon: 'user' }
      }]
    },
  
    // 404!!!
    { path: '*', redirect: '/404', hidden: true }
  ]
  
  // 路由模式
  const createRouter = () => new Router({
    // mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
  })
  
  const router = createRouter()
  // 导出路由
  export function resetRouter() {
    const newRouter = createRouter()
    router.matcher = newRouter.matcher // reset router
  }
  
  export default router
  