vue+springboot前后端分离开发, 将vue编译后的静态资源融入springboot,只需要启动一个后端jar就可以了

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
编译后dist的vue
在这里插入图片描述
前端的工作做完了,然后是springboot的配置

在这里插入图片描述
将编译后的资源加载到springboot里, 这样只需要启动springboot就可以使用vue编译后的代码, 做到前后端分离开发, 最终融入springboot里

注意,

该方法使用后进入前端页面则要改用springboot的静态资源路径

端口使用的是springboot的端口 win本地启动整合后的项目, 则

进入vue前端页面地址为:

pc端为

localhost:8551/tasty_mgr/view/pc/index.html

h5端为

localhost:8551/tasty_mgr/view/mobile/index.html

发布了71 篇原创文章 · 获赞 3 · 访问量 8780

猜你喜欢

转载自blog.csdn.net/qq_40250122/article/details/100707148