请求的这个地址http://www.weather.com.cn/data/cityinfo/101010100.html
是我哪里写的不对吗? 提示GET http://localhost:8080/api/cityinfo/101010100.html 404 (Not Found)
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: "http://www.weather.com.cn/data",
changeOrigin:true,
pathRewrite:{
'^/api':''
}
}
},
methods: {
weather () {
this.$http.get('/cityinfo/101010100.html').then(res => {
console.log(res)
})
}
}
代码有问题,按下面这样子修改就没有问题了。但生产环境下需要配其他方式

代理