修复jsonfield
This commit is contained in:
parent
715311851d
commit
7095fdb634
@ -25,14 +25,13 @@ public class WxTokenUtils {
|
|||||||
|
|
||||||
public static WxAccessToken fetchAccessToken() {
|
public static WxAccessToken fetchAccessToken() {
|
||||||
try {
|
try {
|
||||||
String resStr = HttpUtils.sendGet(tokenUrl, "grant_type=client_credential&appid=" + appId + "secret=" + appSecret);
|
String resStr = HttpUtils.sendGet(tokenUrl, "grant_type=client_credential&appid=" + appId + "&secret=" + appSecret);
|
||||||
if (StringUtils.isEmpty(resStr)) {
|
if (StringUtils.isEmpty(resStr)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
JSONObject obj = JSONObject.parseObject(resStr);
|
JSONObject obj = JSONObject.parseObject(resStr);
|
||||||
|
|
||||||
WxAccessToken token = JSONObject.toJavaObject(obj, WxAccessToken.class);
|
WxAccessToken token = JSONObject.toJavaObject(obj, WxAccessToken.class);
|
||||||
System.out.println(token.toString());
|
|
||||||
return token;
|
return token;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user