diff --git a/nginx.conf b/nginx.conf index a69c3b1..c954ef0 100644 --- a/nginx.conf +++ b/nginx.conf @@ -13,7 +13,7 @@ server { } location /blog-api/ { - proxy_pass http://127.0.0.1:8082/; + proxy_pass http://host.docker.internal:8082/; } location / { diff --git a/src/router/blog.ts b/src/router/blog.ts index f9ea00a..3275a19 100644 --- a/src/router/blog.ts +++ b/src/router/blog.ts @@ -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 diff --git a/src/views/meta.ts b/src/views/meta.ts deleted file mode 100644 index 47e5337..0000000 --- a/src/views/meta.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { IRouteMetaConfig } from 'vue3-common/types' - -export const blogMeta: IRouteMetaConfig = { - -}