vue2.0 获取qq音乐web上的全部歌曲数据

我用vue-resorce 在webpack.dev.conf.js和index.js里面配置了prxyTable:
const proxyTable = {
'/musichall': {

target: 'https://c.y.qq.com',
changeOrigin: true,
pathRewrite: {}

},
'/splcloud': {

target: 'https://c.y.qq.com',
changeOrigin: true,
pathRewrite: {}

}

}
在要获取数据的页面写了方法:
requsetAllList() {

  var api = '/splcloud/fcgi-bin/fcg_yqqhomepagerecommend.fcg'
  this.$http.get(api).then(
    response => {
      console.log(response)
      // this.allList = response.body.data.slider
    },
    error => {
      console.log(error)
    }
  )
}
这么写,不报错,但是获取不到数据,

clipboard.png
请问这个为什么获取不到呢,菜鸟刚接触,不是太懂,多谢大神了
试过了vue-resorce 和axios都弄不对

阅读 3.2k
3 个回答

代理配置问题,谢谢

404找不到啊,url错误

404呐,证明你的url错了。而且你的url为什么是xxxx.fcg