text: import Vue from 'vue'
  import Router from 'vue-router'
  
  Vue.use(Router)
  
  /* Layout */
  import Layout from '@/layout'
  
  /**
   * constantRoutes
   * a base page that does not have permission requirements
   * all roles can be accessed
   */
  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: '/',
      component: Layout,
      redirect: '/system',
      children: [
        {
          path: 'system',
          component: () => import('@/views/dashboard/index'),
          name: 'System',
          meta: { title: 'Overview', icon: 'dashboard', affix: true }
        }
      ]
    },
    {
      path: '/guide',
      component: Layout,
      redirect: '/guide/index',
      children: [
        {
          path: 'index',
          component: () => import('@/views/guide/index'),
          name: 'Guide',
          meta: { title: 'Start Analysing', icon: 'guide', noCache: true }
        }
      ]
    },
    {
      path: '/result',
      component: Layout,
      redirect: '/result/index',
      children: [
        {
          path: 'index',
          component: () => import('@/views/table/table-codeclone'),
          name: 'Result',
          meta: { title: 'Result', icon: 'table' }
        }
      ]
    }
  ]
  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
  