解决微信媒体返回错误问题。
This commit is contained in:
parent
30846819d8
commit
83367ca96d
@ -108,13 +108,13 @@ public class WechatMediaUtil {
|
|||||||
JSONObject jsonObject = new JSONObject(resultStr.toString());
|
JSONObject jsonObject = new JSONObject(resultStr.toString());
|
||||||
log.info("微信媒体上传:" + jsonObject.toString());
|
log.info("微信媒体上传:" + jsonObject.toString());
|
||||||
//判断是否传递成功,如果token过期则重新获取
|
//判断是否传递成功,如果token过期则重新获取
|
||||||
if (jsonObject.get("errcode").equals("0")) {
|
if (jsonObject.get("errcode").equals("40001")) {
|
||||||
return jsonObject.get("media_id").toString();
|
|
||||||
} else if (jsonObject.get("errcode").equals("40001")) {
|
|
||||||
wechatAccessTokenUtil.removeAccessToken(ClientTypeEnum.WECHAT_MP);
|
wechatAccessTokenUtil.removeAccessToken(ClientTypeEnum.WECHAT_MP);
|
||||||
return this.uploadMedia(type, mediaFileUrl);
|
return this.uploadMedia(type, mediaFileUrl);
|
||||||
} else {
|
} else if (jsonObject.get("errcode")!=null) {
|
||||||
throw new ServiceException(jsonObject.get("errmsg").toString());
|
throw new ServiceException(jsonObject.get("errmsg").toString());
|
||||||
|
} else {
|
||||||
|
return jsonObject.get("media_id").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user