ocr.printedText
微信提供的图片解析内容
官方文档:https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/ocr/ocr.printedText.html
随时获取token (可用来测试)
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wx667d6af490440e4b&secret=99e79aa9097aec0b11a28e8b6dad335c
const url = 'https://comall-magic-test.oss-cn-beijing.aliyuncs.com/assets/upload/demo2/image/c062590642fa11a40939e3c78e359c0e.png';
const token = '51_hqOR4G9iheBIrDZ7YKwHJm9qpMKaDrnH0xkz2ocOFtGdBV4mvW2ivMh-agDo3TEgJwwn-semdL72ZSN5rV7pcVxI21KnJp4YWFZP1mcIdTfnR0EiSQn9G02KtM1y1dAOsUCCdf3hUw_Ao7eMTDDiAGANXX';
return $.post('https://api.weixin.qq.com/cv/ocr/comm?img_url='+url+'&access_token='+token).then((res) => {
console.log(res);
});
网上随便找了张图片:
返回结果: