部署在线上的web项目页面手动刷新报404错误,本地调试没问题

在这里插入图片描述

⚠️ 把router里的mode: 'history换成mode: 'hash',就好了

const createRouter = () => new Router({
    // mode: 'history', // require service support
    mode: 'hash',
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
})

const router = createRouter()

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_48259951/article/details/130889105