vue项目中使用的跨域请求:
async getSomeDetail() { await axios.get('/api/someDetail.json').then(res => {
his.someDetail = res.data
})
}dev server代理:
'/api':{
target:'http://localhost:8080',
pathRewrite:{'^/api':'/static/mock'}
}
凤凰求蛊
临摹微笑
随时随地看视频慕课网APP