feat:更新路由模块

This commit is contained in:
2025-09-21 10:23:22 +08:00
parent 52c14f5f6f
commit 7a86aa408e
3 changed files with 47 additions and 9 deletions

View File

@@ -13,7 +13,7 @@ server {
}
location /blog-api/ {
proxy_pass http://127.0.0.1:8082/;
proxy_pass http://host.docker.internal:8082/;
}
location / {

View File

@@ -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

View File

@@ -1,5 +0,0 @@
import { IRouteMetaConfig } from 'vue3-common/types'
export const blogMeta: IRouteMetaConfig = {
}