我在前端请求了小程序码返回的是一堆乱码,
java不太熟网上找了一个方法可以将二进制流和图片互转,但是从微信小程序码接口获取的数据用这个方法无法获取正确的图片,不知道哪里有问题;
有没有只在前端就能获取小程序码的方法
@RequestMapping("/qrTest")
public Map qrTest(Long hotelId, String appId, String token) {
RestTemplate rest = new RestTemplate();
InputStream inputStream = null;
OutputStream outputStream = null;
try {
String url = "https://api.weixin.qq.com/wxa/getwxacode?access_token=" + token;
Map param = new HashMap<>();
param.put("page", "pages/home/home");
param.put("width", 430);
param.put("auto_color", false);
Map line_color = new HashMap<>();
line_color.put("r", 0);
line_color.put("g", 0);
line_color.put("b", 0);
param.put("line_