先获取小程序码二进制流
/**
* 获取小程序码
*/
public static InputStream getWxacodeUnlimit(String accessToken, String path, int width) {
String url = String.format(WXACODE_UNLIMIT_URL, accessToken);
String[] str = path.split("[?]");
String pagePath = str[0];
String scene = str[1];
// 接收参数json列表
JSONObject jsonParam = new JSONObject();
jsonParam.put("scene", scene);
jsonParam.put("page", pagePath);
jsonParam.put("width", width);
jsonParam.put("auto_color", false);
Map<String,Object> line_color = new HashMap<>();
line_color.put("r", 0);
line_color.put("g", 0);
line_color.put("b", 0);
jsonParam.put("line_color", line_color);
jsonParam.put("is_hyaline", false);
InputStream inputStream = HttpClientUtils.post(url, jsonParam);
if (inputStream == null) {
throw new UserWebExceptio