Skip to content

Commit 2c27f8b

Browse files
committed
🐛 #2553 【公众号】修复草稿相关接口返回值多双引号的问题
1 parent 08ea0bd commit 2c27f8b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpDraftServiceImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ public String addDraft(String title, String content, String thumbMediaId) throws
4343
@Override
4444
public String addDraft(WxMpAddDraft addDraft) throws WxErrorException {
4545
String json = this.mpService.post(WxMpApiUrl.Draft.ADD_DRAFT, addDraft);
46-
return GsonParser.parse(json).get(MEDIA_ID).toString();
46+
return GsonParser.parse(json).get(MEDIA_ID).getAsString();
4747
}
4848

4949
@Override
5050
public Boolean updateDraft(WxMpUpdateDraft updateDraftInfo) throws WxErrorException {
5151
String json = this.mpService.post(WxMpApiUrl.Draft.UPDATE_DRAFT, updateDraftInfo);
52-
return GsonParser.parse(json).get(ERRCODE).toString().equals(ERRCODE_SUCCESS);
52+
return GsonParser.parse(json).get(ERRCODE).getAsString().equals(ERRCODE_SUCCESS);
5353
}
5454

5555
@Override
@@ -62,7 +62,7 @@ public WxMpDraftInfo getDraft(String mediaId) throws WxErrorException {
6262
public Boolean delDraft(String mediaId) throws WxErrorException {
6363
String json = this.mpService.post(WxMpApiUrl.Draft.DEL_DRAFT,
6464
GsonHelper.buildJsonObject(MEDIA_ID, mediaId));
65-
return GsonParser.parse(json).get(ERRCODE).toString().equals(ERRCODE_SUCCESS);
65+
return GsonParser.parse(json).get(ERRCODE).getAsString().equals(ERRCODE_SUCCESS);
6666
}
6767

6868
@Override

0 commit comments

Comments
 (0)