修改project.config.js
文件中的proxyUrl
和imgUrl
的地址,改为空
① // proxyUrl: '/test', //本地测试使用的,同时.webpackrc中的
② // imgUrl:'/test',
③ // proxyUrl: 'http://58.240.86.44:59999', //放在tomcat下使用的地址
// imgUrl: 'http://58.240.86.44:59999',
proxyUrl: '',
imgUrl: '',
①其中test是本地测试时使用,配合.webpackrc
中的proxy
"proxy": {
"/test": {
"target": "http://127.0.0.1:10002",
//"target": "http://172.16.11.66:10003",
"changeOrigin": true,
"pathRewrite": {
"^/test": ""
}
},
"/weather": {
"target": "https://www.sojson.com/open/api/weather/json.shtml",
"changeOrigin": true,
"pathRewrite": {
"^/weather": ""
}
}
},
②其中http://58.240.86.44:59999是tomcat下使用的地址
③当时空的时候就是第三种发布方式,然后在前端输入npm run build
,将得到的文件夹(比如文件夹名是dist)放入后台服务application-dev.yml
配置文件spring.resource.static-locations定义的目录中,重启后台服务,在浏览器中输入:172.16.11.66:10003/dist/index.html
网友评论