mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-09-20 18:48:13 +08:00
fix: issue #128
This commit is contained in:
@@ -551,6 +551,9 @@ public class WxCpServiceImpl implements WxCpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
|
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
|
||||||
|
if (uri.indexOf("access_token=") != -1) {
|
||||||
|
throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri);
|
||||||
|
}
|
||||||
String accessToken = getAccessToken(false);
|
String accessToken = getAccessToken(false);
|
||||||
|
|
||||||
String uriWithAccessToken = uri;
|
String uriWithAccessToken = uri;
|
||||||
|
@@ -349,8 +349,9 @@ public class WxMpServiceImpl implements WxMpService {
|
|||||||
* 查询时返回的是 { groups : [ { id : ..., name : ..., count : ... }, ... ] }
|
* 查询时返回的是 { groups : [ { id : ..., name : ..., count : ... }, ... ] }
|
||||||
*/
|
*/
|
||||||
JsonElement tmpJsonElement = Streams.parse(new JsonReader(new StringReader(responseContent)));
|
JsonElement tmpJsonElement = Streams.parse(new JsonReader(new StringReader(responseContent)));
|
||||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement.getAsJsonObject().get("groups"), new TypeToken<List<WxMpGroup>>() {
|
return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement.getAsJsonObject().get("groups"),
|
||||||
}.getType());
|
new TypeToken<List<WxMpGroup>>() {
|
||||||
|
}.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public long userGetGroup(String openid) throws WxErrorException {
|
public long userGetGroup(String openid) throws WxErrorException {
|
||||||
@@ -597,8 +598,9 @@ public class WxMpServiceImpl implements WxMpService {
|
|||||||
param.addProperty("end_date", SIMPLE_DATE_FORMAT.format(endDate));
|
param.addProperty("end_date", SIMPLE_DATE_FORMAT.format(endDate));
|
||||||
String responseContent = post(url, param.toString());
|
String responseContent = post(url, param.toString());
|
||||||
JsonElement tmpJsonElement = Streams.parse(new JsonReader(new StringReader(responseContent)));
|
JsonElement tmpJsonElement = Streams.parse(new JsonReader(new StringReader(responseContent)));
|
||||||
return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement.getAsJsonObject().get("list"), new TypeToken<List<WxMpUserCumulate>>() {
|
return WxMpGsonBuilder.INSTANCE.create().fromJson(tmpJsonElement.getAsJsonObject().get("list"),
|
||||||
}.getType());
|
new TypeToken<List<WxMpUserCumulate>>() {
|
||||||
|
}.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String get(String url, String queryParam) throws WxErrorException {
|
public String get(String url, String queryParam) throws WxErrorException {
|
||||||
@@ -646,6 +648,9 @@ public class WxMpServiceImpl implements WxMpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
|
protected <T, E> T executeInternal(RequestExecutor<T, E> executor, String uri, E data) throws WxErrorException {
|
||||||
|
if (uri.indexOf("access_token=") != -1) {
|
||||||
|
throw new IllegalArgumentException("uri参数中不允许有access_token: " + uri);
|
||||||
|
}
|
||||||
String accessToken = getAccessToken(false);
|
String accessToken = getAccessToken(false);
|
||||||
|
|
||||||
String uriWithAccessToken = uri;
|
String uriWithAccessToken = uri;
|
||||||
|
Reference in New Issue
Block a user