import Vue from 'vue' import Router from 'vue-router' import Layout from '../layout/Layout' Vue.use(Router) export const constantRouterMap = [{ 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: '/remote', component: () => import ('@/remote/index'), hidden: true }, { path: '/404', component: () => import ('@/views/404'), hidden: true }, { path: '/viewhzd/:id', component: () => import ('@/views/bjd/view_hzd'), hidden: true }, { path: '/wenjian/:zlzl/:sbzl/:bjid', component: () => import ('@/views/bjd/sjse/upload_list_20200721'), hidden: true }, { path: '/wenjian/:zlzl/:sbzl/:bjid/:bjparamid', component: () => import ('@/views/bjd/sjse/upload_list_20200721'), hidden: true }, { path: '/upload/:sbzl/:bjid', component: () => import ('@/views/bjd/sjse/upload_list'), hidden: true }, { path: '/upload/:sbzl/:bjid/:bjparamid', component: () => import ('@/views/bjd/sjse/upload_list_param'), hidden: true }, { path: '/xingshi/:sbzl/:bjid', component: () => import ('@/views/bjd/sjse/upload_list_xingshi'), hidden: true }, { path: '/showGrantInfo', component: () => import ('@/views/print/sign_view'), hidden: true }, { path: '/fangwei/:ysjlId/:baogaobianhao', component: () => import ('@/views/security/index'), hidden: true }, { path: '/qiye/:qyid', component: () => import ('@/views/task/qiye_list'), hidden: true }, { path: '/flow/detail', component: () => import ('@/views/flow/detail'), hidden: false }, { path: '', component: Layout, redirect: '/search/search-list', children: [{ path: 'dashboard', component: () => import ('@/views/dashboard/index'), name: 'dashboard', meta: { title: '首页', icon: 'dashboard', noCache: true } }] }, { path: '/profile', component: Layout, redirect: '/profile/index', hidden: true, children: [{ path: 'index', component: () => import ('@/views/profile/index'), name: 'profile', meta: { title: '个人中心', icon: 'profile', noCache: true } }] } ] const createRouter = () => new Router({ // mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap }) const router = createRouter() export function resetRouter() { const newRouter = createRouter() router.matcher = newRouter.matcher // reset router } export default router