router/index.js
import { createRouter, createWebHistory } from 'vue-router'
import { routes } from '@/router/routes'const router = new createRouter({
history: createWebHistory(import.meta.env.VITE_BASE_URL),
routes
})router.beforeEach((to) => {
console.log('[ROUTER]', to)
})export default router
.env
VITE_BASE_URL=/h5
nginx.conf
server {
listen 80;
server_name abc.com;root /data/webapps/project-01;
index index.html;location /h5/ {
try_files $uri $uri/ /h5/index.html?$query_string;
}
include error.conf;
}