豆瓣網址請求不到數據
rp(`http://api.douban.com/v2/movie/in_theaters?start=${event.start}&count=${event.count}`).then(function?(res)?{console.log(res);return?res;}).catch(function?(err)?{console.log(err);});
rp(`http://api.douban.com/v2/movie/in_theaters?start=${event.start}&count=${event.count}`).then(function?(res)?{console.log(res);return?res;}).catch(function?(err)?{console.log(err);});
2019-05-31
舉報
2019-05-31
上面同學回答的API都是正確的。如果代碼中報400錯誤的話,就說明是客戶端問題,也就是說你的調用云函數的地方有問題,不是API的問題。
2019-06-03
同學,你解決問題了嗎,我也出現了同樣的問題,我的控制臺顯示內容也是null
2019-05-31
老師在其它回答里解釋過了,如下
由于最近API有變化,需要在請求API的url后面跟一個apikey參數:
電影列表API:http://api.douban.com/v2/movie/in_theaters?apikey=0df993c66c0c636e29ecbb5344252a4a&start=0&count=10
電影詳情API:http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a