景区二维码下载

This commit is contained in:
2025-02-17 12:45:23 +08:00
parent 344118e926
commit d10d706597
2 changed files with 36 additions and 3 deletions

View File

@ -34,12 +34,12 @@ public class WxMpUtil {
return ACCESS_TOKEN;
}
public static void generateWXAQRCode(String appId, String appSecret, String path, String filePath) throws Exception {
public static void generateWXAQRCode(String appId, String appSecret, String envVersion, String path, String filePath) throws Exception {
String url = String.format(GET_WXA_CODE_URL, getAccessToken(appId, appSecret));
CloseableHttpClient httpClient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost(url);
JSONObject json = new JSONObject();
json.put("env_version", "trial");
json.put("env_version", envVersion);
json.put("path", path);
json.put("width", 1000);
StringEntity entity = new StringEntity(json.toJSONString(), "utf-8");
@ -58,6 +58,6 @@ public class WxMpUtil {
}
public static void main(String[] args) throws Exception {
generateWXAQRCode("wxe7ff26af70bfc37c", "5252fbbc68513bc77b7cc0052b9f9695", "pages/home/index?scenicId=3946669713328836608", "cxzh_t.jpg");
// generateWXAQRCode("wxe7ff26af70bfc37c", "5252fbbc68513bc77b7cc0052b9f9695", "pages/home/index?scenicId=3946669713328836608", "cxzh_t.jpg");
}
}