微信媒体返回

This commit is contained in:
lifenlong 2021-06-25 16:03:14 +08:00
parent 4fd8e4ecef
commit 3c2cf69cbe

View File

@ -185,6 +185,7 @@ public class WechatLivePlayerUtil {
/**
* 请求微信接口
*
* @param url 链接
* @param map 参数
* @return 返回内容
@ -193,14 +194,14 @@ public class WechatLivePlayerUtil {
//获取token
String token = wechatAccessTokenUtil.cgiAccessToken(ClientTypeEnum.WECHAT_MP);
//请求链接添加token
url+=token;
url += token;
//发起请求
String content = HttpUtils.doPostWithJson(url, map);
//记录请求结果
log.info("微信小程序请求结果:" + content);
//获取请求内容如果token过期则重新获取如果出错则抛出错误
JSONObject jsonObject = new JSONObject(content);
if (jsonObject.get("errcode").equals("0")) {
if (jsonObject.get("media_id") != null) {
return jsonObject;
} else if (jsonObject.get("errcode").equals("40001")) {
wechatAccessTokenUtil.removeAccessToken(ClientTypeEnum.WECHAT_MP);