图片审查接口传huang图也返回ok?
调用imgSecCheck传黄图也返回ok
// 云函数入口文件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: { contentType: 'image/jpg', value: Buffer.from(value) } }) return res; } catch (err) { return err; }} |
wx.cloud.init({}) wx.cloud.callFunction({ name: "imgseccheck", data: { value: buffer.data } }).then( imgRes => { console.log(imgRes) if (imgRes.result.errorCode == "87014") { wx.showToast({ title: '图片含有违法违规内容', icon: 'none', duration: 1000, }) setTimeout(function() { wx.navigateBack() }, 1000) return } else { //图片正常 } } ) |
