From 2b8f7ab4a0481a471e1235493c582796754b7efa Mon Sep 17 00:00:00 2001 From: yeeway Date: Mon, 15 Jan 2024 01:34:06 +0800 Subject: [PATCH] fix: modify project base path and route path --- src/dist/router.dev.js | 2 +- src/router.js | 2 +- src/style.css | 2 +- src/views/About.vue | 3 +++ src/views/Info.vue | 3 +++ src/views/Partners.vue | 3 +++ src/views/Souvenir.vue | 3 +++ vite.config.js | 2 +- 8 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/dist/router.dev.js b/src/dist/router.dev.js index ae623dd..5a044e0 100644 --- a/src/dist/router.dev.js +++ b/src/dist/router.dev.js @@ -160,7 +160,7 @@ _letterToHighSchoolStudents["default"].map(function (letter) { }); var router = (0, _vueRouter.createRouter)({ - history: (0, _vueRouter.createWebHistory)(), + history: (0, _vueRouter.createWebHistory)('/BikeFestival17th-Frontend/'), routes: routes }); var _default = router; diff --git a/src/router.js b/src/router.js index 3e51fef..f4d4a94 100644 --- a/src/router.js +++ b/src/router.js @@ -75,7 +75,7 @@ letterToHighSchoolStudentsData.map((letter) => { }); const router = createRouter({ - history: createWebHistory(), + history: createWebHistory('/BikeFestival17th-Frontend/'), routes, }); diff --git a/src/style.css b/src/style.css index d94d9e9..7c64fa4 100644 --- a/src/style.css +++ b/src/style.css @@ -7,7 +7,7 @@ font-family: "Noto Sans TC", sans-serif; } body { - background-image: url(../public/bg_noise_texture.svg); + background-image: url(/public/bg_noise_texture.svg); background-color: #FFF8F2; } } \ No newline at end of file diff --git a/src/views/About.vue b/src/views/About.vue index 04c9786..a803993 100644 --- a/src/views/About.vue +++ b/src/views/About.vue @@ -1,4 +1,7 @@ diff --git a/src/views/Info.vue b/src/views/Info.vue index e6014fd..ba91474 100644 --- a/src/views/Info.vue +++ b/src/views/Info.vue @@ -1,5 +1,8 @@ diff --git a/src/views/Partners.vue b/src/views/Partners.vue index 74b99d4..3211618 100644 --- a/src/views/Partners.vue +++ b/src/views/Partners.vue @@ -1,4 +1,7 @@ diff --git a/src/views/Souvenir.vue b/src/views/Souvenir.vue index 0b51053..2112f98 100644 --- a/src/views/Souvenir.vue +++ b/src/views/Souvenir.vue @@ -1,4 +1,7 @@ diff --git a/vite.config.js b/vite.config.js index 69322e9..684eca1 100644 --- a/vite.config.js +++ b/vite.config.js @@ -4,5 +4,5 @@ import vue from '@vitejs/plugin-vue' // https://vitejs.dev/config/ export default defineConfig({ plugins: [vue()], - base: '/', + base: process.env.NODE_ENV === 'production' ? '/BikeFestival17th-Frontend/' : '/', }) \ No newline at end of file