This commit is contained in:
Daniel Qian
2015-08-03 17:30:28 +08:00
parent 0acae5783a
commit cf9ccbc54d
2 changed files with 12 additions and 4 deletions

View File

@@ -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;

View File

@@ -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;