根目录下创建 vue.config.js(小程序不存在跨域)
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:8800',
ws: true,
changeOrigin: true,
pathRewirte:{ //
'^/api':''
}
},
'/foo':{
target:'http://localhost:3000'
}
}
}
}