after obtaining token through appid and secret, the API for calling Mini Program to obtain unrestricted QR code is as follows:
var token = res.data.access_token;
wx.request({
url: "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + token,
method: "POST",
data: {
scene: "orderId=" + orderId,
path: "pages/hall/receiveDetail/receiveDetail",
width: 258,
auto_color: false,
line_color: { "r": "0", "g": "0", "b": "0" }
},
header:{
"content-type": "application/json;charset=utf-8"
},
success: function (res) {
callback(res.data);
}
})
Screenshot of the returned result:
pass the second parameter path as page, in the official document, but the request with page will not succeed. It always prompts you that the parameter is incorrect. If it is changed to path, it will be successful, but garbled will be returned.
I would like to ask whether it is a request problem or some other reason, because when you use php to deal with image garbled, it is prompted that it is not a picture when you save it.