vue获取https://y.qq.com/m/index.html qq音乐上的接口
https://c.y.qq.com/musichall/... 接口
methods: {
requsetData() {
var api =
'https://c.y.qq.com/musichall/fcgi-bin/fcg_yqqhomepagerecommend.fcg'
this.$http.get(api).then(
response => {
console.log(response)
},
error => {
console.log(error)
}
)
}
},
报错:
请问这个改怎么解决,我用jsonp,不包这个跨域的问题,但是获取不到数据
CORS和jsonp都是需要服务器端配合的,建议采用服务器端中转请求的方式来实现,类似
koa-proxy
这个包