问题还没解决,目前改用后台调用图片检测接口。
云开发 security.imgSecCheck 调用响应错误使用云函数调用 security.imgSecCheck ,对图片进行鉴黄请求响应为: [代码]{[代码] [代码]errMsg: [代码][代码]"cloud.callFunction:ok",[代码] [代码]result:{[代码][代码] errCode: 41005[代码][代码] errMsg: [代码][代码]"openapi.security.imgSecCheck:fail media data missing hint: [9ZGoCA02628622]" [代码] [代码] }[代码] [代码]}[代码] 云函数代码如下: [代码]const cloud = require([代码][代码]'wx-server-sdk'[代码][代码])[代码] [代码]cloud.init();[代码] [代码]// 云函数入口函数[代码][代码]exports.main = (event) => {[代码][代码] [代码][代码]console.log(event);[代码][代码] [代码][代码]return[代码] [代码]cloud.openapi.security[代码][代码] [代码][代码].imgSecCheck({[代码][代码] [代码][代码]media: {[代码][代码] [代码][代码]contentType: [代码][代码]'image/png'[代码][代码],[代码][代码] [代码][代码]value: event.img[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码].then(result => {[代码][代码] [代码][代码]return[代码] [代码]result;[代码][代码] [代码][代码]})[代码][代码] [代码][代码].[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]return[代码] [代码]err;[代码][代码] [代码][代码]})[代码][代码]}[代码] 调用代码如下: [代码]uploadImg: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]this[代码][代码].selectImg().then(img => {[代码][代码] [代码][代码]console.log(img);[代码][代码] [代码][代码]return[代码] [代码]this[代码][代码].imgSecCheck(img);[代码][代码] [代码][代码]}).then(res => {[代码][代码] [代码][代码]console.log([代码][代码]"success:"[代码][代码], res);[代码][代码] [代码][代码]}).[代码][代码]catch[代码][代码](err => {[代码][代码] [代码][代码]console.log([代码][代码]"fail"[代码][代码], err);[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] // 选择图片并转为 buffer [代码] [代码][代码]selectImg: [代码][代码]function[代码][代码]() {[代码][代码] [代码][代码]return[代码] [代码]new[代码] [代码]Promise((resolve, reject) => {[代码][代码] [代码][代码]wx.chooseImage({[代码][代码] [代码][代码]count: 1,[代码][代码] [代码][代码]sizeType: [[代码][代码]'original'[代码][代码], [代码][代码]'compressed'[代码][代码]],[代码][代码] [代码][代码]success: [代码][代码]function[代码][代码](res) {[代码][代码] [代码][代码]let params = {[代码][代码] [代码][代码]filePath: res.tempFilePaths[0][代码][代码] [代码][代码]};[代码][代码] [代码][代码]wx.getFileSystemManager()[代码][代码] [代码][代码].readFile({[代码][代码] [代码][代码]filePath: res.tempFilePaths[0],[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]console.log([代码][代码]"readSuccess:"[代码][代码], res);[代码][代码] [代码][代码]resolve(res.data);[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: err => {[代码][代码] [代码][代码]console.log([代码][代码]"readFail:"[代码][代码], err);[代码][代码] [代码][代码]reject(err);[代码][代码] [代码][代码]}[代码][代码] [代码][代码]});[代码] [代码] [代码][代码]},[代码][代码] [代码][代码]})[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码] // 调用云函数[代码] [代码][代码]imgSecCheck: [代码][代码]function[代码][代码](img) {[代码][代码] [代码][代码]return[代码] [代码]wx.cloud.callFunction({[代码][代码] [代码][代码]name: [代码][代码]"imgSecCheck"[代码][代码],[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]img: img[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码]
2019-08-20可长按识别的二维码[图片] 不可长按识别的二维码 [图片]
微信长按识别二维码问题- 当前 Bug 的表现(可附上截图) 生成的小程序二维码在部分手机的微信聊天页中不能长按识别,而在一些手机就可以。 [图片] [图片] - 预期表现 - 复现路径 - 提供一个最简复现 Demo
2018-11-01