You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

116 lines
2.5 KiB

3 years ago
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: '/showGrantInfo',
component: () =>
import ('@/views/print/sign_view'),
hidden: true
},
{
path: '/fangwei/:ysjlId/:baogaobianhao',
component: () =>
import ('@/views/security/index'),
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 }
}]
}
// {
// path: '/certificate',
// component: Layout,
// redirect: '/certificate/certificate-list',
// name: 'certificate',
// meta: { title: '证书管理', menus: 'certificate' },
// children: [{
// path: 'certificate-list',
// name: 'CertificateList',
// component: () =>
// import ('@/views/certificate/index'),
// meta: { title: '证书管理', icon: 'certificate' }
// },
// {
// path: 'certificateshow',
// name: 'CertificateShow',
// component: () =>
// import ('@/views/certificate/show'),
// meta: { tite: '证书信息', icon: 'certificate' },
// hidden: true
// }
// ]
// }
3 years ago
]
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