text: import Vue from "vue";
  import Router from "vue-router";
  
  Vue.use(Router);
  
  /* Layout */
  import Layout from "@/layout";
  
  /**
   * 定义组件名称和组件对象的map对象
   */
  export const componentMap = {
    Layout: Layout,
    testArrange_index: () => import("@/views/testArrange"),
    teacherClass_index: () => import("@/views/teacherClass"),
    scoreArrange_index: () => import("@/views/scoreArrange"),
    topicArrange_index: () => import("@/views/topicArrange"),
    icons_index: () => import("@/views/icons"),
    routeMaintain_index: () => import("@/views/routeMaintain"),
    classMaintain_index: () => import("@/views/classMaintain"),
    roleMaintain_index: () => import("@/views/roleMaintain"),
    studentsMaintain_index: () => import("@/views/studentsMaintain"),
    userMaintain_index: () => import("@/views/userMaintain"),
  
  
  };
  
  /**
   * 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                   如果设置为true，条目将不会显示在侧栏中(默认为false)
   * alwaysShow: true               如果设置为true，将始终显示根菜单
   *                                如果没有设置alwaysShow，当item有多个子路由时，
   *                                它将变成嵌套模式，否则不会显示根菜单
   * redirect: noRedirect           如果设置noRedirect将不会在面包屑中重定向
   * name:'router-name'             keep-alive使用这个名字。(必须设置! !)
   * meta : {
      roles: ['admin','editor']    控制页面角色(可以设置多个角色)
      title: 'title'               名称显示在侧边栏和breadcrumb(推荐设置)
      icon: 'svg-name'/'el-icon-x' 图标显示在侧边栏
      noCache: true                如果设置为true，页面将不会被缓存(默认为false)
      affix: true                  如果设置为true，标记将被添加到标记视图中
      breadcrumb: false            如果设置为false，则该项将隐藏在breadcrumb中(默认为true)
      activeMenu: '/example/list'  如果设置路径，侧边栏将突出显示您设置的路径
    }
   */
  
  /**
   * constantRoutes
   * 没有权限要求的基本页面
   * 所有角色均可访问
   */
  export const constantRoutes = [
    {
      path: "/redirect",
      component: Layout,
      hidden: true,
      children: [
        {
          path: "/redirect/:path(.*)",
          component: () => import("@/views/redirect/index")
        }
      ]
    },
    {
      path: "/login",
      component: () => import("@/views/login/index"),
      hidden: true
    },
    {
      path: "/auth-redirect",
      component: () => import("@/views/login/auth-redirect"),
      hidden: true
    },
    {
      path: "/404",
      component: () => import("@/views/error-page/404"),
      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: "首页",
          meta: { title: "首页", icon: "dashboard", affix: 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;
  