Vue项目打包后放入SpringBoot
参考地址:https://cli.vuejs.org/zh/config/#publicpathhttps://www.cnblogs.com/kevinZhu/p/9931317.htmlhttps://www.cnblogs.com/qianjinyan/p/11001906.html放入SpringBoot的resources后,直接在浏览器输入http://localhos...
·
参考地址:
https://cli.vuejs.org/zh/config/#publicpath
https://www.cnblogs.com/kevinZhu/p/9931317.html
https://www.cnblogs.com/qianjinyan/p/11001906.html
放入SpringBoot的resources后,直接在浏览器输入http://localhost:XXXX/index.html即可。
如果前端使用的路由模式是history的,那么可以发现第一次访问页面没有任何问题,刷新页面便会报错404。
解决方法:
1.将路由模式改成hash模式;
2.重定向,如果 URL 匹配不到任何静态资源,则应该返回同一个 index.html
页面,这个页面就是你 app 依赖的页面。
更多推荐
已为社区贡献22条内容
所有评论(0)