老師,請看一下電影詳情頁還是不顯示
我把js代碼改成了wx.request的了但還是不行,會顯示400
我的代碼如下:
onLoad: function (options) {
wx.showLoading({
title: '加載中',
})
wx.request({
url: `https://frodo.douban.com/api/v2/movie/${options.movieid}?apiKey=054022eaeae0b00e0fc068c0c0a2102a`,
method: "GET",
header: {
'content-type': 'application/json' // 默認值
},
success(res) {
console.log(res.data),
wx.hideLoading();
},
fail(err) {
console.error(err);
wx.hideLoading();
}
})
},
是不是沒有加setdata的原因啊,如果要加setdata那需要怎么加呢,老師請指教
2022-04-09
建議仔細看一下課程首頁的課程公告,里面有詳細的代碼。
1、這個接口需要在云函數端調用
2、headers屬性中有的是不需要寫的
2022-04-09
我的api是這樣寫的
請老師看一下有沒有問題