Vue local debugging solves cross-domain problems
- Open the index.js file under the project config folder
- Configure proxyTable proxy
proxyTable: {
'/api': {
target: 'https://xxx.xxx.xxx.xx', // 接口域名
changeOrigin: true, //是否跨域
secure: false,
pathRewrite: {
'^/api': ''
}
}
},
3. Open the dev.env.js file in the
config directory for configuration 4. Open the dev.prod.env.js in the config directory for configuration