使用版本:V1.9.7 场景:通过config.js配置跨域使axios能够提交到node开发的后端 问题:config中配置跨域不生效 报错:
GET http://localhost:8080/api/editor 404 (Not Found)
具体配置如下:
configureWebpack: {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8085/api',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
}
},
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8085/api',
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},