1,配置相关
hash:true 版本控制
我们在开发模式的时候写axios时会在接口前面加一个"/api" 我们在打包之前同样要去掉,变成后端给的那种接口,这样在部署到服务器的时候,接口路径才能正确
我的项目中在如下设置了,所以只要把 "/api" 去掉就好了
2,打包,然后会生成一个dist文件夹
扫描二维码关注公众号,回复:
4748762 查看本文章
npm run build
3,将dist文件夹,放到tomcat服务器上,
4,浏览器输入https://xxxxx.com/dist/就可以打开了