时间:2019-05-05 来源:小程序工厂
小***:
遇到同样的问题,楼主解决没??
S***:
哦,我解决了。 是给微信传参编码问题。下面是我node.js 调用的方法:
request({
method: 'POST',
url: 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token='+access_token,
encoding: null, // 这里是关键,必须设置这个参数
body: JSON.stringify({
page: 'pages/index/index',
scene: '-',
auto_color: true,
width: "300"
})
}, function(error, response, body) {
// console.log('body--->',body)
res.writeHead(200, {'Content-Type': 'image/png'});
res.write(body, 'binary');
res.end();
});
相关编码文章:https://segmentfault.com/a/1190000002787763
微信小程序编辑器上传按钮没反应