云函数 循环调用 安全内容接口 security.imgSecCheck超时出错?
发布于 6 年前 作者 eluo 9161 次浏览 来自 官方Issues
for (let index in event.imgBufferList) {  //图片数组
      let imageResult = await cloud.openapi.security.imgSecCheck({
        media: {
          header: { 'Content-Type': 'application/octet-stream' },
          contentType: 'image/png',
          value: Buffer.from(event.imgBufferList[index])
        }
      })
  }

报错: cloud.callFunction:fail timeout for result fetching,result cannot be fetched

一张图片不会报错,两张就会报错

2 回复

这个api没有header吧

不应该用for,应该用promise,一张检测完再检测另一张。当然,这是我的建议。

看看我之前写的文章。看看对你有没有帮助。链接https://developers.weixin.qq.com/community/develop/article/doc/00062c5c7a8ec834dc692913156013

回到顶部