OCR调用出错,怎么从本地图片识别证件号码?
服务接口(API Name)
OcrAllInOne
根据官方OCR调用文档,调用出错(https://developers.weixin.qq.com/community/servicemarket/detail/000ce4cec24ca026d37900ed551415)
wx.serviceMarket.invokeService({
service: 'wx79ac3de8be320b71', // 'wx_mp_appid',
api: 'OcrAllInOne',
data: {
img_url: url,
data_type: 3,
ocr_type: 1,
},
}).then(res => {
console.log('invokeService success', res)
wx.showModal({
title: 'cost',
content: (Date.now() - d) + '',
})
}).catch(err => {
console.log(base64);
console.error('invokeService fail', err)
wx.showModal({
title: 'fail',
content: err + '',
})
})
换成公网图片是可以请求的,但是如何识别本地证件文件