#395 修复获取小程序二维码data format error的问题

This commit is contained in:
Binary Wang 2017-12-07 11:54:17 +08:00
parent 7b64b6b4a0
commit 0714cbe8e2
2 changed files with 9 additions and 7 deletions

View File

@ -8,10 +8,12 @@ import cn.binarywang.wx.miniapp.util.json.WxMaGsonBuilder;
* @author Element
*/
public abstract class AbstractWxMaQrcodeWrapper {
@Override
public String toString() {
public String toJson() {
return WxMaGsonBuilder.create().toJson(this);
}
@Override
public String toString() {
return this.toJson();
}
}

View File

@ -40,7 +40,7 @@ public class QrCodeRequestExecutor implements RequestExecutor<File, AbstractWxMa
RequestConfig.custom().setProxy(requestHttp.getRequestHttpProxy()).build()
);
}
httpPost.setEntity(new StringEntity(ticket.toString()));
httpPost.setEntity(new StringEntity(ticket.toJson()));
try (CloseableHttpResponse response = requestHttp.getRequestHttpClient().execute(httpPost);
InputStream inputStream = InputStreamResponseHandler.INSTANCE.handleResponse(response);) {