config.js里面添加
proxy: { // 配置跨域
'/api': {
target: 'http://10.1.3.31:8000/', // 后台地址
changOrigin: true, // 允许跨域
pathRewrite: {
'^/api': '' // 重写路径
},
headers: {
Connection: 'keep-alive'
}
}
},
前端跨域
最新推荐文章于 2023-04-24 08:45:00 发布