本地可以正常访问,部署以后报错如下:
解决方法: 在项目router目录下添加mode: "hash"
export default new Router({
mode: 'hash',
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
前端重新打dist包上传,页面正常显示
本地可以正常访问,部署以后报错如下:
解决方法: 在项目router目录下添加mode: "hash"
export default new Router({
mode: 'hash',
scrollBehavior: () => ({ y: 0 }),
routes: constantRoutes
})
前端重新打dist包上传,页面正常显示