vue的web端解决跨域请求问题

module.exports = {
publicPath: './',
devServer: {
proxy: {
//配置跨域
'/api': {
target: 'http:/IP:端口号',
changOrigin: true, //允许跨域
pathRewrite: {
'^/api': ''
}
}
}
}
}

关注我的公众号SpaceObj 领取idea系列激活码

posted on 2023-05-11 09:39  张伯灵  阅读(47)  评论(0)    收藏  举报