云开发 图片安全检测 imgSecCheck 如何加快速度?

发布于 8 年前作者 ming143643 次浏览最后编辑 8 年前来自 ask

const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async(event, context) => {
  const {
    value
  } = event;
  try {
    const res = await cloud.openapi.security.imgSecCheck({
      media: {
        header: {
          'Content-Type': 'application/octet-stream'
        },
        contentType: 'image/png',
        value: Buffer.from(value)
      }
    })
    return res;
  } catch (err) {
    return err;
  }
}
1 回复
jielin
jielin1 楼6 年前