fix frontend router url base

This commit is contained in:
sinsong 2023-06-28 17:47:13 +08:00
parent 1845d1329b
commit 24ede16076
2 changed files with 3 additions and 1 deletions

View file

@ -4,7 +4,7 @@ import Index from './views/Index.vue'
import Package from './views/Package.vue'
const router = createRouter({
history: createWebHistory(),
history: createWebHistory(__WEBSITE_BASE__),
routes: [
{ path: '/', component: Index },
{ path: '/:packageName', component: Package }

View file

@ -9,6 +9,8 @@ export default defineConfig(({command}) => { return {
plugins: [
replace({
// production / development environment api base
__WEBSITE_BASE__: command === 'build' ? JSON.stringify('/packages')
: JSON.stringify(''),
__API_BASE__: command === 'build' ? JSON.stringify('https://bioarchlinux.org')
: JSON.stringify(''),
preventAssignment: true,