| | |
| | | /* Layout */ |
| | | import Layout from '@/layout' |
| | | |
| | | import demo_router from './demo_router' |
| | | import system_router from './system_router' |
| | | import op_router from './op_router' |
| | | // import demo_router from './demo_router' |
| | | import sms_router from './sms_router' |
| | | // import system_router from './system_router' |
| | | // import op_router from './op_router' |
| | | // import agreement_router from './agreement_router' |
| | | |
| | | /** |
| | | * 注:子菜单只出现在路线子时。长度> = 1 |
| | |
| | | }] |
| | | }, |
| | | |
| | | system_router, |
| | | demo_router, |
| | | // system_router, |
| | | sms_router, |
| | | // demo_router, |
| | | // agreement_router, |
| | | |
| | | { |
| | | path: 'external-link', |
| | | component: Layout, |
| | | children: [ |
| | | { |
| | | path: 'https://panjiachen.github.io/vue-element-admin-site/#/', |
| | | meta: { title: '外链', icon: 'link' }, |
| | | auth: 'external_link' |
| | | } |
| | | ] |
| | | }, |
| | | // { |
| | | // path: 'external-link', |
| | | // component: Layout, |
| | | // children: [ |
| | | // { |
| | | // path: 'https://panjiachen.github.io/vue-element-admin-site/#/', |
| | | // meta: { title: '外链', icon: 'link' }, |
| | | // auth: 'external_link' |
| | | // } |
| | | // ] |
| | | // }, |
| | | |
| | | // { |
| | | // path: '/demo', |
| | |
| | | // ] |
| | | // }, |
| | | |
| | | op_router, |
| | | // op_router, |
| | | |
| | | // 404 page must be placed at the end !!! |
| | | { path: '*', redirect: '/404', hidden: true } |
| | |
| | | |
| | | const router = createRouter() |
| | | |
| | | // 守卫,处理keepAlive周期,用isBack标记是否属于从属页面后退 |
| | | router.beforeEach(function(to, from, next) { |
| | | // 判断是否从从属页面后退 |
| | | if (to.meta.keepAlive && from.meta.activeMenu === to.path) { |
| | | to.meta.isBack = true |
| | | } else { |
| | | to.meta.isBack = false |
| | | } |
| | | next(true) |
| | | }) |
| | | |
| | | // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 |
| | | export function resetRouter() { |
| | | const newRouter = createRouter() |