Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

获取小程序二维码失败 #395

Closed
totzcc opened this issue Dec 6, 2017 · 3 comments
Closed

获取小程序二维码失败 #395

totzcc opened this issue Dec 6, 2017 · 3 comments

Comments

@totzcc
Copy link

totzcc commented Dec 6, 2017

wxMaService.getQrcodeService().createWxCodeLimit(idScene, null)

错误信息


me.chanjar.weixin.common.exception.WxErrorException: {"errcode":47001,"errmsg":"data format error hint: [Ox8o30679wxa6]"}
	at cn.binarywang.wx.miniapp.util.http.QrCodeRequestExecutor.execute(QrCodeRequestExecutor.java:52) ~[weixin-java-miniapp-2.9.0.jar:na]
	at cn.binarywang.wx.miniapp.util.http.QrCodeRequestExecutor.execute(QrCodeRequestExecutor.java:28) ~[weixin-java-miniapp-2.9.0.jar:na]
	at cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl.executeInternal(WxMaServiceImpl.java:193) ~[weixin-java-miniapp-2.9.0.jar:na]
	at cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl.execute(WxMaServiceImpl.java:156) ~[weixin-java-miniapp-2.9.0.jar:na]
	at cn.binarywang.wx.miniapp.api.impl.WxMaQrcodeServiceImpl.createWxCodeLimit(WxMaQrcodeServiceImpl.java:64) ~[weixin-java-miniapp-2.9.0.jar:na]
	at cn.binarywang.wx.miniapp.api.impl.WxMaQrcodeServiceImpl.createWxCodeLimit(WxMaQrcodeServiceImpl.java:70) ~[weixin-java-miniapp-2.9.0.jar:na]

跟踪代码发现
cn.binarywang.wx.miniapp.util.http.QrCodeRequestExecutor#execute 43行
设置的entity 为 text/plan, 微信要求的请求是 application/json

httpPost.setEntity(new StringEntity(ticket.toString()));
@binarywang
Copy link
Owner

感谢提出此问题,但出错的原因不在于此,稍后准备修复一下

@charmingoh
Copy link

需要吧 WxMaWxcodeLimit 的 toString 函数去掉。

@binarywang
Copy link
Owner

2.9.2.BETA版本已修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants