请求地址:https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=
请求参数:
参数1:
param = "se=-100&us=16031";
String params = "{\"scene\": \"" + param + "\", \"page\": \"" + MiniAppsQrCOdeConstans.PATH + "\", \"width\": " + MiniAppsQrCOdeConstans.WIDTH + "}";
返回结果:
成功:
ResponseEntityProxy{[Content-Type: image/jpeg,Content-Length: 195169,Chunked: false]}
参数2:
param = "se=-100&us=16031&pis=CWIvd5IZWeX-J1tC3pA2EwI";
String params = "{\"scene\": \"" + param + "\", \"page\": \"" + MiniAppsQrCOdeConstans.PATH + "\", \"width\": " + MiniAppsQrCOdeConstans.WIDTH + "}";
返回结果:
失败:
ResponseEntityProxy{[Content-Type: application/json; encoding=utf-8,Content-Length: 215,Chunked: false]}
你可以解析一下json,看看报错是什么。
scene字段限制最大32个可见字符,你这里超过限制了。
看文档呀,失败了会返回json的,成功才返回图片的buffer
https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/qrcode-link/qr-code/getUnlimitedQRCode.html
{"errcode":40169,"errmsg":"invalid length for scene, or the data is not json string rid: 669e174a-303bcbd1-71c3ffbf"}
接口总得报错吧,报错也返回图片,然后OCR识别错误内容,不可能吧。返回json就转字符串看报错,别生成图片