[微信小程序]请求在开发者工具可以获得,到真机上始终加载中 [此话怎讲?]+ 查看更多
- 当前 Bug 的表现(可附上截图)
- 预期表现
加载出内容
- 问题描述
我自己这边手机上怎么也加不出来,但在开发者工具中就能加载出来。
原来这个app是可以用的,在过年之前突然变成这样。
请求就是小程序调用云函数,如截图。 云函数也就是简单的一个request请求封装,调用其他域名的接口。
云函数代码截图如下
使用的 SDK 为: https://github.com/willin/wnm
日志:
END RequestId: cb1b3496-3727-11e9-acb3-525400235f2a
Report RequestId: cb1b3496-3727-11e9-acb3-525400235f2a Duration:849.116ms Memory:256MB MaxMemoryUsed:30.3125MB
示例代码:
```js
const SDK = require('wnm');
SDK.user.record({
uid: 12797402,
type: '0'
}).then(({
body: {
allData: songs =[]
} = {}
}) => songs.map(({
song: {
song: {
id,
name: music,
artist: {
name: artist
}
}
}
}) => SDK.comment.hot({
id,
type: 0
}).then(({ body: { hotComments } }) => hotComments.filter(({ content, likedCount }) => content.length > 100 || likedCount > 1e5)
)))
.then(p => Promise.all(p))
.then(p => [].concat.call(...p))
.then(JSON.stringify).then(console.log);
```
请求结果大概 314kb。
-
, 如果你什么都不说,我也不知道怎么回答你呀我在自己手机上使用楼主的小程序,尝试了多个帐号都是正常的,未能复现该问题 看楼主提供的云函数日志,后端调用也是正常的,麻烦楼主看下是否你的手机网络或者帐号逻辑有什么特殊的地方。 如果还能复现,提供一下微信号,我们来进一步定位一下问题 ps: 测试过程反倒是发现该小程序有个数据库写失败的错误,一直不断重试,麻烦顺便看一下。 -502001,message: "Update Fail: write errors: [{E11000 duplicate key error collection: tnt-jni11hke6.comments index: _id_ dup key: { : "c-472290446" }}]" } , 说的貌似很有深意,你能一条一条说么?, 如果你什么都不说,我也不知道怎么回答你呀