2019-04-01 09:07:16 +00:00
|
|
|
// Just a mock data
|
|
|
|
|
|
|
|
export const constantRoutes = [
|
|
|
|
{
|
|
|
|
path: '/redirect',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
hidden: true,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '/redirect/:path*',
|
|
|
|
component: 'views/redirect/index'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/login',
|
|
|
|
component: 'views/login/index',
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/auth-redirect',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/login/auth-redirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/404',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/error-page/404',
|
2019-04-01 09:07:16 +00:00
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/401',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/error-page/401',
|
2019-04-01 09:07:16 +00:00
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: 'dashboard',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'dashboard',
|
|
|
|
component: 'views/dashboard/index',
|
|
|
|
name: 'Dashboard',
|
2019-04-28 06:51:11 +00:00
|
|
|
meta: { title: 'dashboard', icon: 'dashboard', affix: true }
|
2019-04-01 09:07:16 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/documentation',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/documentation/index',
|
|
|
|
name: 'Documentation',
|
|
|
|
meta: { title: 'documentation', icon: 'documentation', affix: true }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/guide',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/guide/index',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/guide/index',
|
|
|
|
name: 'Guide',
|
|
|
|
meta: { title: 'guide', icon: 'guide', noCache: true }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
export const asyncRoutes = [
|
|
|
|
{
|
|
|
|
path: '/permission',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/permission/index',
|
|
|
|
alwaysShow: true,
|
|
|
|
meta: {
|
|
|
|
title: 'permission',
|
|
|
|
icon: 'lock',
|
|
|
|
roles: ['admin', 'editor']
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'page',
|
|
|
|
component: 'views/permission/page',
|
|
|
|
name: 'PagePermission',
|
|
|
|
meta: {
|
|
|
|
title: 'pagePermission',
|
|
|
|
roles: ['admin']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'directive',
|
|
|
|
component: 'views/permission/directive',
|
|
|
|
name: 'DirectivePermission',
|
|
|
|
meta: {
|
|
|
|
title: 'directivePermission'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'role',
|
|
|
|
component: 'views/permission/role',
|
|
|
|
name: 'RolePermission',
|
|
|
|
meta: {
|
|
|
|
title: 'rolePermission',
|
|
|
|
roles: ['admin']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/icon',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
2019-04-17 03:45:12 +00:00
|
|
|
component: 'views/icons/index',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'Icons',
|
|
|
|
meta: { title: 'icons', icon: 'icon', noCache: true }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/components',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'ComponentDemo',
|
|
|
|
meta: {
|
|
|
|
title: 'components',
|
|
|
|
icon: 'component'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'tinymce',
|
|
|
|
component: 'views/components-demo/tinymce',
|
|
|
|
name: 'TinymceDemo',
|
|
|
|
meta: { title: 'tinymce' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'markdown',
|
|
|
|
component: 'views/components-demo/markdown',
|
|
|
|
name: 'MarkdownDemo',
|
|
|
|
meta: { title: 'markdown' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'json-editor',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/json-editor',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'JsonEditorDemo',
|
|
|
|
meta: { title: 'jsonEditor' }
|
|
|
|
},
|
|
|
|
{
|
2019-04-12 09:13:27 +00:00
|
|
|
path: 'split-pane',
|
|
|
|
component: 'views/components-demo/split-pane',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'SplitpaneDemo',
|
|
|
|
meta: { title: 'splitPane' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'avatar-upload',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/avatar-upload',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'AvatarUploadDemo',
|
|
|
|
meta: { title: 'avatarUpload' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'dropzone',
|
|
|
|
component: 'views/components-demo/dropzone',
|
|
|
|
name: 'DropzoneDemo',
|
|
|
|
meta: { title: 'dropzone' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'sticky',
|
|
|
|
component: 'views/components-demo/sticky',
|
|
|
|
name: 'StickyDemo',
|
|
|
|
meta: { title: 'sticky' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'count-to',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/count-to',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'CountToDemo',
|
|
|
|
meta: { title: 'countTo' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'mixin',
|
|
|
|
component: 'views/components-demo/mixin',
|
|
|
|
name: 'ComponentMixinDemo',
|
|
|
|
meta: { title: 'componentMixin' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'back-to-top',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/back-to-top',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'BackToTopDemo',
|
|
|
|
meta: { title: 'backToTop' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'drag-dialog',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/drag-dialog',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'DragDialogDemo',
|
|
|
|
meta: { title: 'dragDialog' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'drag-select',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/drag-select',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'DragSelectDemo',
|
|
|
|
meta: { title: 'dragSelect' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'dnd-list',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/dnd-list',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'DndListDemo',
|
|
|
|
meta: { title: 'dndList' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'drag-kanban',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/components-demo/drag-kanban',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'DragKanbanDemo',
|
|
|
|
meta: { title: 'dragKanban' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/charts',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'Charts',
|
|
|
|
meta: {
|
|
|
|
title: 'charts',
|
|
|
|
icon: 'chart'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'keyboard',
|
|
|
|
component: 'views/charts/keyboard',
|
|
|
|
name: 'KeyboardChart',
|
|
|
|
meta: { title: 'keyboardChart', noCache: true }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'line',
|
|
|
|
component: 'views/charts/line',
|
|
|
|
name: 'LineChart',
|
|
|
|
meta: { title: 'lineChart', noCache: true }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'mixchart',
|
|
|
|
component: 'views/charts/mixChart',
|
|
|
|
name: 'MixChart',
|
|
|
|
meta: { title: 'mixChart', noCache: true }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/nested',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/nested/menu1/menu1-1',
|
|
|
|
name: 'Nested',
|
|
|
|
meta: {
|
|
|
|
title: 'nested',
|
|
|
|
icon: 'nested'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1',
|
|
|
|
component: 'views/nested/menu1/index',
|
|
|
|
name: 'Menu1',
|
|
|
|
meta: { title: 'menu1' },
|
|
|
|
redirect: '/nested/menu1/menu1-1',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1-1',
|
|
|
|
component: 'views/nested/menu1/menu1-1',
|
|
|
|
name: 'Menu1-1',
|
|
|
|
meta: { title: 'menu1-1' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu1-2',
|
|
|
|
component: 'views/nested/menu1/menu1-2',
|
|
|
|
name: 'Menu1-2',
|
|
|
|
redirect: '/nested/menu1/menu1-2/menu1-2-1',
|
|
|
|
meta: { title: 'menu1-2' },
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'menu1-2-1',
|
|
|
|
component: 'views/nested/menu1/menu1-2/menu1-2-1',
|
|
|
|
name: 'Menu1-2-1',
|
|
|
|
meta: { title: 'menu1-2-1' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu1-2-2',
|
|
|
|
component: 'views/nested/menu1/menu1-2/menu1-2-2',
|
|
|
|
name: 'Menu1-2-2',
|
|
|
|
meta: { title: 'menu1-2-2' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu1-3',
|
|
|
|
component: 'views/nested/menu1/menu1-3',
|
|
|
|
name: 'Menu1-3',
|
|
|
|
meta: { title: 'menu1-3' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'menu2',
|
|
|
|
name: 'Menu2',
|
|
|
|
component: 'views/nested/menu2/index',
|
|
|
|
meta: { title: 'menu2' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/example',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/example/list',
|
|
|
|
name: 'Example',
|
|
|
|
meta: {
|
|
|
|
title: 'example',
|
|
|
|
icon: 'example'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'create',
|
|
|
|
component: 'views/example/create',
|
|
|
|
name: 'CreateArticle',
|
|
|
|
meta: { title: 'createArticle', icon: 'edit' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'edit/:id(\\d+)',
|
|
|
|
component: 'views/example/edit',
|
|
|
|
name: 'EditArticle',
|
|
|
|
meta: { title: 'editArticle', noCache: true },
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'list',
|
|
|
|
component: 'views/example/list',
|
|
|
|
name: 'ArticleList',
|
|
|
|
meta: { title: 'articleList', icon: 'list' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/tab',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/tab/index',
|
|
|
|
name: 'Tab',
|
|
|
|
meta: { title: 'tab', icon: 'tab' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/error',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'ErrorPages',
|
|
|
|
meta: {
|
|
|
|
title: 'errorPages',
|
|
|
|
icon: '404'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: '401',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/error-page/401',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'Page401',
|
|
|
|
meta: { title: 'page401', noCache: true }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '404',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/error-page/404',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'Page404',
|
|
|
|
meta: { title: 'page404', noCache: true }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/error-log',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'log',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/error-log/index',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'ErrorLog',
|
|
|
|
meta: { title: 'errorLog', icon: 'bug' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/excel',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/excel/export-excel',
|
|
|
|
name: 'Excel',
|
|
|
|
meta: {
|
|
|
|
title: 'excel',
|
|
|
|
icon: 'excel'
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'export-excel',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/excel/export-excel',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'ExportExcel',
|
|
|
|
meta: { title: 'exportExcel' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'export-selected-excel',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/excel/select-excel',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'SelectExcel',
|
|
|
|
meta: { title: 'selectExcel' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'export-merge-header',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/excel/merge-header',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'MergeHeader',
|
|
|
|
meta: { title: 'mergeHeader' }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'upload-excel',
|
2019-04-12 09:13:27 +00:00
|
|
|
component: 'views/excel/upload-excel',
|
2019-04-01 09:07:16 +00:00
|
|
|
name: 'UploadExcel',
|
|
|
|
meta: { title: 'uploadExcel' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/zip',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/zip/download',
|
|
|
|
alwaysShow: true,
|
|
|
|
meta: { title: 'zip', icon: 'zip' },
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'download',
|
|
|
|
component: 'views/zip/index',
|
|
|
|
name: 'ExportZip',
|
|
|
|
meta: { title: 'exportZip' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/pdf',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
redirect: '/pdf/index',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/pdf/index',
|
|
|
|
name: 'PDF',
|
|
|
|
meta: { title: 'pdf', icon: 'pdf' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: '/pdf/download',
|
|
|
|
component: 'views/pdf/download',
|
|
|
|
hidden: true
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/theme',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/theme/index',
|
|
|
|
name: 'Theme',
|
|
|
|
meta: { title: 'theme', icon: 'theme' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/clipboard',
|
|
|
|
component: 'layout/Layout',
|
2019-04-16 05:51:14 +00:00
|
|
|
redirect: 'noRedirect',
|
2019-04-01 09:07:16 +00:00
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/clipboard/index',
|
|
|
|
name: 'ClipboardDemo',
|
|
|
|
meta: { title: 'clipboardDemo', icon: 'clipboard' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: '/i18n',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'index',
|
|
|
|
component: 'views/i18n-demo/index',
|
|
|
|
name: 'I18n',
|
|
|
|
meta: { title: 'i18n', icon: 'international' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: 'external-link',
|
|
|
|
component: 'layout/Layout',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
path: 'https://github.com/PanJiaChen/vue-element-admin',
|
|
|
|
meta: { title: 'externalLink', icon: 'link' }
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
|
|
|
|
{ path: '*', redirect: '/404', hidden: true }
|
|
|
|
]
|