Loading

spring-boot vue 整合部分页面404

现象

通过页面点击跳转好使,
http://ip:8888/inputManage/englishList
直接通过复制到浏览器
http://ip:8888/inputManage/englishList

解决

  • 一开始一直想后端如果404就 redirect:/index.html;这个找了好多资料都不行
  • 准备放弃了用nginx解决。用try_files解决,该问题
  • 前端大大说vue-router不要用history模式,用hash试试。

参考资料

再异常统一重定向/index.html

总结

  • 需要注意spring-boot单机版用hash模式带有#
  • 其他情况最好不要用hash模式了,上次也是做h5分享前端带了#搞了好久。
  • 当然最理想的情况还是nginx+spring-boot+vue 吧。
posted @ 2020-12-02 13:39  世界这么美还没钱去看  阅读(872)  评论(0编辑  收藏  举报