🐛 #1185 修正第三方小程序部分请求和返回对象

This commit is contained in:
S
2019-08-29 13:59:46 +08:00
committed by Binary Wang
parent b0ff3f0e93
commit e463c78437
4 changed files with 42 additions and 2 deletions

View File

@@ -416,8 +416,8 @@ public class WxOpenComponentServiceImpl implements WxOpenComponentService {
public List<WxOpenMaCodeTemplate> getTemplateList() throws WxErrorException {
String responseContent = get(GET_TEMPLATE_LIST_URL, "access_token");
JsonObject response = JSON_PARSER.parse(StringUtils.defaultString(responseContent, "{}")).getAsJsonObject();
boolean hasDraftList = response.has("template_list");
if (hasDraftList) {
boolean hasTemplateList = response.has("template_list");
if (hasTemplateList) {
return WxOpenGsonBuilder.create().fromJson(response.getAsJsonArray("template_list"),
new TypeToken<List<WxOpenMaCodeTemplate>>() {
}.getType());