There is no cross-domain in the applet, but if it is an H5 project, there is a cross-domain:
Create vue.config.js in the root directory:
module.exports = {
devServer: {
proxy: {
'/api': {
target: 'http://localhost:7788',
ws: true,
changeOrigin: true,
pathRewirte:{ //路径重写
'^/api':''
}
},
'/foo':{
target:'http://localhost:3001'
}
}
}
}