課程
/前端開發
/小程序
/輕松入門微信小程序與云開發
點擊評價后會報錯然后appdata也不會有結果
2019-08-16
源自:輕松入門微信小程序與云開發 4-4
正在回答
`http://api.douban.com/v2/movie/subject/27163278?apikey=0df993c66c0c636e29ecbb5344252a4a`? 這個是有數據的,返回null, 需要確認下你的云函數是否返回了res,比如如下寫法:
```
var rp = require('request-promise')
// 云函數入口函數
exports.main = async (event, context) => {
console.log('event', event)
return rp(`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`)
.then(res => {
console.log('res', res)
return res;
})
.catch(err => {
console.error(err)
}
慕運維5126052
還是不行,老師幫一下忙吧,謝謝
電影詳細參數改為:電影詳情API:`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`
追吧king
舉報
深入淺出微信小程序核心基礎與云開發,使你掌握小程序開發必備技能。
2 回答老師我的tabber出不來啊,能幫忙看一下嗎
3 回答40411問題沒有解決,能否幫幫忙,感謝
2 回答老師,麻煩解決一下,謝謝!
2 回答老師幫幫忙
2 回答老師還有同學們我的詳情頁跳轉有問題,幫忙解決一下唄,謝謝了
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2019-08-25
`http://api.douban.com/v2/movie/subject/27163278?apikey=0df993c66c0c636e29ecbb5344252a4a`? 這個是有數據的,返回null, 需要確認下你的云函數是否返回了res,比如如下寫法:
```
var rp = require('request-promise')
// 云函數入口函數
exports.main = async (event, context) => {
console.log('event', event)
return rp(`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`)
.then(res => {
console.log('res', res)
return res;
})
.catch(err => {
console.error(err)
})
}
```
2019-08-17
還是不行,老師幫一下忙吧,謝謝
2019-08-16
電影詳細參數改為:電影詳情API:`http://api.douban.com/v2/movie/subject/${event.movieid}?apikey=0df993c66c0c636e29ecbb5344252a4a`