feat:更新路由模块
This commit is contained in:
@@ -13,7 +13,7 @@ server {
|
||||
}
|
||||
|
||||
location /blog-api/ {
|
||||
proxy_pass http://127.0.0.1:8082/;
|
||||
proxy_pass http://host.docker.internal:8082/;
|
||||
}
|
||||
|
||||
location / {
|
||||
|
||||
@@ -1,7 +1,50 @@
|
||||
import BlogLayout from '@/layout/index.vue'
|
||||
import { getRoutersByModules } from 'vue3-common/utils/routerUtil'
|
||||
import { blogMeta } from '@/views/meta'
|
||||
import { RouteRecordRaw } from 'vue-router'
|
||||
|
||||
const blogRoutes = getRoutersByModules(import.meta.glob('@/views/**/*.vue'), BlogLayout, blogMeta)
|
||||
const blogRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: '/overview',
|
||||
redirect: '/overview/index',
|
||||
component: BlogLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/overview/index',
|
||||
component: () => import('@/views/overview.vue')
|
||||
},
|
||||
{
|
||||
path: '/overview/detail:id',
|
||||
name: 'DetailId',
|
||||
component: () => import('@/views/detail[id].vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/category',
|
||||
redirect: '/category/index',
|
||||
component: BlogLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/category/index',
|
||||
component: () => import('@/views/category.vue')
|
||||
},
|
||||
{
|
||||
path: '/category:name',
|
||||
name: 'CategoryName',
|
||||
component: () => import('@/views/category[name].vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/archive',
|
||||
redirect: '/archive/index',
|
||||
component: BlogLayout,
|
||||
children: [
|
||||
{
|
||||
path: '/archive/index',
|
||||
component: () => import('@/views/archive.vue')
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default blogRoutes
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { IRouteMetaConfig } from 'vue3-common/types'
|
||||
|
||||
export const blogMeta: IRouteMetaConfig = {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user