Use vue-cli to set up a reverse proxy to solve cross-domain problems

In index.js under the config folder, add the following code

proxyTable: { 
'/apis': { //Print the interface domain name as /apis
target: 'http://192.168.3.104:3000', //Interface domain name
changeOrigin: true, //Whether cross domain
pathRewrite: {
' ^/apis': '' //Need to rewrite,
}
}
},

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324901812&siteId=291194637