云开发 图片安全检测 imgSecCheck 如何加快速度?
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;
}
}