From df1de6a8ca9bf6af14d858fb51d077c00dd2dd48 Mon Sep 17 00:00:00 2001 From: huanghongfa <huanghongfa123456> Date: 星期五, 23 七月 2021 13:08:41 +0800 Subject: [PATCH] 修改bug --- springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java index cf00d38..75549a9 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/WxOfficialApi.java @@ -113,8 +113,15 @@ * @return 文章内容 */ public static R getActicle(String url) { + // post发送的参数 + Map<String, Object> map = new HashMap<>(); + map.put("type", "news"); // news表示图文类型的素材,具体看API文档 + map.put("offset", 0); + map.put("count", 5); + // 将map转换成json字符串 + String paramBody = JSON.toJSONString(map); // 请求与响应 - String resp = HttpClientUtil.get(url, getWxHeaderMap()); + String resp = HttpClientUtil.get(url, getWxHeaderMap(),paramBody); log.info(resp); return R.ok(resp); } -- Gitblit v1.7.1