2022-01-08 17:20:46 +08:00
|
|
|
import Layout from '@/layout/index.vue'
|
|
|
|
import Dashboard from '@/views/dashboard/index.vue'
|
|
|
|
|
|
|
|
export const basicRoutes = [
|
|
|
|
{
|
|
|
|
name: '404',
|
|
|
|
path: '/404',
|
|
|
|
component: () => import('@/views/error-page/404.vue'),
|
|
|
|
isHidden: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'REDIRECT',
|
|
|
|
path: '/redirect',
|
|
|
|
component: Layout,
|
|
|
|
isHidden: true,
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: 'REDIRECT_NAME',
|
|
|
|
path: '',
|
|
|
|
component: () => import('@/views/redirect/index.vue'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'LOGIN',
|
|
|
|
path: '/login',
|
|
|
|
component: () => import('@/views/login/index.vue'),
|
|
|
|
isHidden: true,
|
|
|
|
meta: {
|
|
|
|
title: '登录页',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
name: 'HOME',
|
|
|
|
path: '/',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/dashboard',
|
|
|
|
meta: {
|
|
|
|
title: '首页',
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: 'DASHBOARD',
|
|
|
|
path: 'dashboard',
|
|
|
|
component: Dashboard,
|
|
|
|
meta: {
|
|
|
|
title: 'Dashboard',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2022-02-25 14:08:17 +08:00
|
|
|
{
|
|
|
|
name: 'ERROR-PAGE',
|
|
|
|
path: '/error-page',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/error-page/404',
|
|
|
|
meta: {
|
|
|
|
title: '错误页',
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: 'ERROR-404',
|
|
|
|
path: '404',
|
|
|
|
component: () => import('@/views/error-page/404.vue'),
|
|
|
|
meta: {
|
|
|
|
title: '404',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
|
2022-01-08 17:20:46 +08:00
|
|
|
{
|
|
|
|
name: 'TEST',
|
|
|
|
path: '/test',
|
|
|
|
component: Layout,
|
|
|
|
redirect: '/test/unocss',
|
|
|
|
meta: {
|
|
|
|
title: '测试',
|
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: 'UNOCSS',
|
|
|
|
path: 'unocss',
|
|
|
|
component: () => import('@/views/test-page/TestUnocss.vue'),
|
|
|
|
meta: {
|
|
|
|
title: '测试unocss',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'MESSAGE',
|
|
|
|
path: 'message',
|
|
|
|
component: () => import('@/views/test-page/TestMessage.vue'),
|
|
|
|
meta: {
|
|
|
|
title: '测试Message',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'DIALOG',
|
|
|
|
path: 'dialog',
|
|
|
|
component: () => import('@/views/test-page/TestDialog.vue'),
|
|
|
|
meta: {
|
|
|
|
title: '测试Dialog',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-02-15 14:29:06 +08:00
|
|
|
|
|
|
|
{
|
|
|
|
name: 'EXTERNAL-LINK',
|
|
|
|
path: '/external-link',
|
|
|
|
component: Layout,
|
|
|
|
meta: {
|
2022-02-25 14:08:17 +08:00
|
|
|
title: '外部链接',
|
2022-02-15 14:29:06 +08:00
|
|
|
},
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
name: 'LINK-GITHUB-SRC',
|
|
|
|
path: 'https://github.com/zclzone/vue-naive-admin',
|
|
|
|
meta: {
|
|
|
|
title: '源码 - github',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'LINK-GITEE-SRC',
|
|
|
|
path: 'https://gitee.com/zclzone/vue-naive-admin',
|
|
|
|
meta: {
|
|
|
|
title: '源码 - gitee',
|
|
|
|
},
|
|
|
|
},
|
2022-02-16 09:08:05 +08:00
|
|
|
{
|
|
|
|
name: 'LINK-DOCS',
|
|
|
|
path: 'https://www.yuque.com/qszone/vue-naive-admin',
|
|
|
|
meta: {
|
|
|
|
title: '文档 - 语雀',
|
|
|
|
},
|
|
|
|
},
|
2022-02-15 14:29:06 +08:00
|
|
|
],
|
|
|
|
},
|
2022-01-08 17:20:46 +08:00
|
|
|
]
|
|
|
|
|
|
|
|
export const NOT_FOUND_ROUTE = {
|
|
|
|
name: 'NOT_FOUND',
|
|
|
|
path: '/:pathMatch(.*)*',
|
|
|
|
redirect: '/404',
|
|
|
|
isHidden: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
const modules = import.meta.globEager('./modules/*.js')
|
|
|
|
const asyncRoutes = []
|
|
|
|
Object.keys(modules).forEach((key) => {
|
|
|
|
asyncRoutes.push(...modules[key].default)
|
|
|
|
})
|
|
|
|
|
|
|
|
export { asyncRoutes }
|