huanghongfa
2021-07-23 df1de6a8ca9bf6af14d858fb51d077c00dd2dd48
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);
    }