收藏
回答

generate_urllink 返回链接为什么不带query参数?

String urlnew = "https://api.weixin.qq.com/wxa/generate_urllink?access_token="+responseMap.get("access_token");

//创建连接
CloseableHttpClient httpClientnew = HttpClients.createDefault();

HttpResponse responsenew = null;
// 构建请求体
JSONObject requestBody = new JSONObject();
requestBody.put("path", "/pages/"); // 小程序页面路径(不可携带 query)
requestBody.put("query", "yqbh="+(String) param.get("yqbh")); // 查询参数


// 发送请求
 xcxlj = sendPostRequest(urlnew, requestBody.toJSONString());

//规避返回数据为空的情况
Map responseMaps = StringToMap.stringToMap(xcxlj);
urllink=responseMaps.get("url_link");

参数也有值

最后一次编辑于  2025-03-15
回答关注问题邀请回答
收藏
登录 后发表内容