vue-router mode为hash模式, url中带有#,mode为 'history'就能去掉#号,也可以正常访问,但是再次线上刷新页面就会出现404错误。
解决办法:在router.js文件中把history模式改为hash模式
const router = createRouter({
// history: createWebHistory(process.env.BASE_URL),
history: createWebHashHistory(process.env.BASE_URL),
routes
})