改用其他方式了,ocr插件比较好用
调用idCardOCR接口异常errcode: 41005,怎么处理?调用idCardOCR接口异常errcode: 41005 accessToken获取正常 传入的图片地址外网能正常访问,http+域名的地址,后台代码如下: public JSONObject getIdCardInfo(String type, String imgUrl, String accessToken) { String requestUrl = "https://api.weixin.qq.com/cv/ocr/idcard?access_token=" + accessToken; String data = HttpRequest .post(requestUrl) .header("content-type", "application/x-www-form-urlencoded") .body(String.format("{'img_url':'%s'}", imgUrl)) .execute() .body(); JSONObject json = JSONObject.parseObject(data); log.error("解析结果:"+json.toJSONString()); String errcode = json.getString("errcode"); if (!"0".equals(errcode)) { } return json; }
2023-10-19