mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-23 22:11:40 +08:00
替换hard code
This commit is contained in:
parent
cb78119cdd
commit
2ec3c527c2
@ -27,6 +27,8 @@ import me.chanjar.weixin.mp.bean.*;
|
||||
import me.chanjar.weixin.mp.bean.result.*;
|
||||
import me.chanjar.weixin.mp.util.http.*;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import org.apache.commons.io.Charsets;
|
||||
import org.apache.http.Consts;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
@ -48,6 +50,7 @@ import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.Charset;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
@ -478,7 +481,7 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
public String qrCodePictureUrl(String ticket) throws WxErrorException {
|
||||
String url = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=%s";
|
||||
try {
|
||||
return String.format(url, URLEncoder.encode(ticket, "utf-8"));
|
||||
return String.format(url, URLEncoder.encode(ticket, Charsets.UTF_8.name()));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
WxError error = new WxError();
|
||||
error.setErrorCode(-1);
|
||||
|
Loading…
Reference in New Issue
Block a user