1.项目修改
vue.config.js增加

 publicPath: '/'

2.nginx配置

location / {#访问前端页面
	root /data/dist;#vue项目存放路径
	index  index.html; #hash模式只配置访问html就可以了
	try_files $uri $uri/ /index.html;#history模式配置否则会出现vue的路由在nginx中刷新出现404
}
Logo

更多推荐