課程
/前端開發
/小程序
/輕松入門微信小程序與云開發
之前都運行正常,能爬到數據。昨天就全返回null了,日志如上
2020-10-02
源自:輕松入門微信小程序與云開發 4-4
正在回答
?onLoad:?function(options)?{
????var?that?=?this
???//?console.log(options);??
????this.setData({
??????movieId:?options.movieid
????});
????wx.showLoading({
??????title:?'加載中',
????})
????wx.request({
??????url:?`https://frodo.douban.com/api/v2/movie/${options.movieid}?apiKey=054022eaeae0b00e0fc068c0c0a2102a`,
??????method:"GET",
??????//header?:?{},
??????success:function(res){
????????console.log(res.data)
????????if?(res.statusCode==200){
???????????that.setData({
?????????????detail:res.data
???????????})
????????}
????????wx.hideLoading();
??????},
??????fail:function(err){
????????console.error(err)
??????}
??},
改成request方式可以出來數據,很奇怪為什么云函數方式不行!
西流蘇 提問者
weixin_慕婉清1174456 回復 西流蘇 提問者
西流蘇 提問者 回復 weixin_慕婉清1174456
河星 回復 西流蘇 提問者
qq_慕運維1537906 回復 西流蘇 提問者
我的也不行了,一樣的錯誤
舉報
深入淺出微信小程序核心基礎與云開發,使你掌握小程序開發必備技能。
3 回答返回值為null
2 回答返回值為null
1 回答返回值為null
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2020-10-09
?onLoad:?function(options)?{
????var?that?=?this
???//?console.log(options);??
????this.setData({
??????movieId:?options.movieid
????});
????wx.showLoading({
??????title:?'加載中',
????})
????wx.request({
??????url:?`https://frodo.douban.com/api/v2/movie/${options.movieid}?apiKey=054022eaeae0b00e0fc068c0c0a2102a`,
??????method:"GET",
??????//header?:?{},
??????success:function(res){
????????console.log(res.data)
????????if?(res.statusCode==200){
???????????that.setData({
?????????????detail:res.data
???????????})
????????}
????????wx.hideLoading();
??????},
??????fail:function(err){
????????console.error(err)
????????wx.hideLoading();
??????}
????})
??},
改成request方式可以出來數據,很奇怪為什么云函數方式不行!
2020-10-09
我的也不行了,一樣的錯誤