2018-10-12 07:10:11 +08:00
|
|
|
|
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'
|
|
|
|
|
|
|
2019-03-10 09:19:35 +08:00
|
|
|
|
// 由于懒加载页面太多的话会造成webpack热更新太慢,所以开发环境不使用懒加载,只有生产环境使用懒加载
|
|
|
|
|
|
const _import = require('@/libs/util.import.' + process.env.NODE_ENV)
|
|
|
|
|
|
|
2018-10-12 07:10:11 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 在主框架内显示
|
|
|
|
|
|
*/
|
|
|
|
|
|
const frameIn = [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '/',
|
|
|
|
|
|
redirect: { name: 'index' },
|
|
|
|
|
|
component: layoutHeaderAside,
|
|
|
|
|
|
children: [
|
2019-03-11 14:09:23 +08:00
|
|
|
|
// 首页
|
2018-10-12 07:10:11 +08:00
|
|
|
|
{
|
|
|
|
|
|
path: 'index',
|
|
|
|
|
|
name: 'index',
|
2019-01-16 10:45:00 +08:00
|
|
|
|
meta: {
|
|
|
|
|
|
auth: true
|
|
|
|
|
|
},
|
2019-03-11 14:09:23 +08:00
|
|
|
|
component: _import('system/index')
|
2018-11-05 23:13:28 +08:00
|
|
|
|
},
|
2019-03-19 19:50:23 +08:00
|
|
|
|
// 系统 前端日志
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'log',
|
|
|
|
|
|
name: 'log',
|
|
|
|
|
|
meta: {
|
|
|
|
|
|
title: '前端日志',
|
|
|
|
|
|
auth: true
|
|
|
|
|
|
},
|
|
|
|
|
|
component: _import('system/log')
|
|
|
|
|
|
},
|
2018-11-05 23:13:28 +08:00
|
|
|
|
// 刷新页面 必须保留
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'refresh',
|
|
|
|
|
|
name: 'refresh',
|
|
|
|
|
|
hidden: true,
|
2019-03-11 14:09:23 +08:00
|
|
|
|
component: _import('system/function/refresh')
|
2018-11-05 23:13:28 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 页面重定向 必须保留
|
|
|
|
|
|
{
|
|
|
|
|
|
path: 'redirect/:route*',
|
|
|
|
|
|
name: 'redirect',
|
|
|
|
|
|
hidden: true,
|
2019-03-11 14:09:23 +08:00
|
|
|
|
component: _import('system/function/redirect')
|
2018-10-12 07:10:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
},
|
|
|
|
|
|
playground,
|
|
|
|
|
|
frame,
|
|
|
|
|
|
d2Crud,
|
|
|
|
|
|
plugins,
|
|
|
|
|
|
charts,
|
|
|
|
|
|
components,
|
|
|
|
|
|
element,
|
|
|
|
|
|
business
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 在主框架之外显示
|
|
|
|
|
|
*/
|
|
|
|
|
|
const frameOut = [
|
|
|
|
|
|
// 登录
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '/login',
|
|
|
|
|
|
name: 'login',
|
2019-03-11 14:09:23 +08:00
|
|
|
|
component: _import('system/login')
|
2018-10-12 07:10:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 错误页面
|
|
|
|
|
|
*/
|
|
|
|
|
|
const errorPage = [
|
|
|
|
|
|
{
|
|
|
|
|
|
path: '*',
|
|
|
|
|
|
name: '404',
|
2019-03-11 14:09:23 +08:00
|
|
|
|
component: _import('system/error/404')
|
2018-10-12 07:10:11 +08:00
|
|
|
|
}
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
// 导出需要显示菜单的
|
|
|
|
|
|
export const frameInRoutes = frameIn
|
|
|
|
|
|
|
|
|
|
|
|
// 重新组织后导出
|
|
|
|
|
|
export default [
|
|
|
|
|
|
...frameIn,
|
|
|
|
|
|
...frameOut,
|
|
|
|
|
|
...errorPage
|
|
|
|
|
|
]
|