鍍金池/ 問答/HTML/ vue axios獲取數(shù)據(jù),status為200,不報(bào)錯(cuò),獲取不到數(shù)據(jù)

vue axios獲取數(shù)據(jù),status為200,不報(bào)錯(cuò),獲取不到數(shù)據(jù)

代碼如下:
methods:{

datailData(singerId){
  var url = '/api/v8/fcg-bin/fcg_v8_singer_track_cp.fcg';
   const commonParams = {
    g_tk: 1928093487,
    inCharset: 'utf-8',
    outCharset: 'utf-8',
    notice: 0,
    format: 'jsonp'
  };
   const data = Object.assign({}, commonParams, {
    hostUin:0,
    needNewCode:0,
    platform:'yqq',
    order:'listen',
    begin:0,
    num:80,
    songstatus:1,
    singermid:singerId
  })
  return Axios.get(url,{
    headers:{
      referer:'https://c.y.qq.com',
      host:'c.y.qq.com'
    },
    params:data
  }).then(response=>{
    console.log(response);
  })
}

}

console.log出來是這樣的:

clipboard.png
這是獲取qq音樂,歌手詳情頁的數(shù)據(jù),

clipboard.png
路由是變了,但是數(shù)據(jù)沒有,axios沒有獲取到數(shù)據(jù),
請大神幫忙看看,非常感謝

回答
編輯回答
別瞎鬧

data屬性值里面 code 400 message failed~ 是不是需要根據(jù)這項(xiàng)來判斷

2017年8月12日 20:34
編輯回答
故林

你服務(wù)器返回的狀態(tài)就是200啊 應(yīng)該是樓上說的 判斷data里面的code吧

2017年8月20日 00:39
編輯回答
墨小羽

是id傳輸?shù)挠袉栴},用js獲取url 最后一個(gè)斜杠后面的內(nèi)容,作為id獲取數(shù)據(jù)

2017年1月14日 23:49