Files
mes-ui-d2/src/router/routes.js
liyang 22b6003da1 刷新方法和重定向方法升级
Former-commit-id: 585670458831c80f57d20e9283fb82476b946e27 [formerly eb7045546e2bd98ba5b5c5e7578c56588b2e3a1d] [formerly 585670458831c80f57d20e9283fb82476b946e27 [formerly eb7045546e2bd98ba5b5c5e7578c56588b2e3a1d] [formerly 585670458831c80f57d20e9283fb82476b946e27 [formerly eb7045546e2bd98ba5b5c5e7578c56588b2e3a1d] [formerly eb7045546e2bd98ba5b5c5e7578c56588b2e3a1d [formerly ce225a2891d4ce5ff086775b9b486bdbf8ee3e86 [formerly 1808e7dd59762f0a4c7e0aceb66ca2e6212d1ca1]]]]]
Former-commit-id: 9845611172f6adb3ed6fdb713d72f23a9dd49f00
Former-commit-id: 9f6810a3f586a57ebb79a19924357771d41b9bbf
Former-commit-id: 371348953967cfe88c0b2dce944e521a5c95b835 [formerly c7863b7e22f5ab553a97b828da52fbbcc6f73381]
Former-commit-id: 58b6d3a88b0f06cb5813bfe913ba113f8bd9d703
Former-commit-id: cdaef260dbddecc1848dbbe5fd75a070d305e1e5
Former-commit-id: 1a1369bb32c9b8599ee8688da2d0dbbeab4b06e2
Former-commit-id: 69be53f5764c10f665dc29fb9f3ac54f71ea639c
Former-commit-id: 6883200052e680c1478e801401fe0d014ebf696c
2018-11-05 23:13:28 +08:00

99 lines
1.9 KiB
JavaScript

import playground from './modules/playground'
import frame from './modules/frame'
import d2Crud from './modules/d2-crud'
import plugins from './modules/plugins'
import charts from './modules/charts'
import components from './modules/components'
import element from './modules/element'
import business from './modules/business'
import layoutHeaderAside from '@/layout/header-aside'
const meta = { requiresAuth: true }
/**
* 在主框架内显示
*/
const frameIn = [
{
path: '/',
redirect: { name: 'index' },
component: layoutHeaderAside,
children: [
// 首页 必须 name:index
{
path: 'index',
name: 'index',
meta,
component: () => import('@/pages/index')
},
// 刷新页面 必须保留
{
path: 'refresh',
name: 'refresh',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
next(vm => vm.$router.replace(from.fullPath))
},
render: h => h()
}
},
// 页面重定向 必须保留
{
path: 'redirect/:route*',
name: 'redirect',
hidden: true,
component: {
beforeRouteEnter (to, from, next) {
next(vm => vm.$router.replace(JSON.parse(from.params.route)))
},
render: h => h()
}
}
]
},
playground,
frame,
d2Crud,
plugins,
charts,
components,
element,
business
]
/**
* 在主框架之外显示
*/
const frameOut = [
// 登录
{
path: '/login',
name: 'login',
component: () => import('@/pages/login')
}
]
/**
* 错误页面
*/
const errorPage = [
// 404
{
path: '*',
name: '404',
component: () => import('@/pages/error-page-404')
}
]
// 导出需要显示菜单的
export const frameInRoutes = frameIn
// 重新组织后导出
export default [
...frameIn,
...frameOut,
...errorPage
]