配置跨域:
historyApiFallback: true,
allowedHosts: 'all',
headers: {
'Access-Control-Allow-Origin': '*'
}
devServer: {
open: true,
host: 'localhost',
port: 8081,
hot: true,
historyApiFallback: true,
allowedHosts: 'all',
headers: {
'Access-Control-Allow-Origin': '*'
},
proxy: {
'/api': {
target: 'http://xxx.xxx.xxx.xxx:8082/',
pathRewrite: {
'^/api': ''
},
changeOrigin: true,
secure: false
}
}
},