|
|
|
@ -17,6 +17,7 @@ import javax.annotation.Resource;
|
|
|
|
|
import java.security.MessageDigest;
|
|
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Base64;
|
|
|
|
|
import java.util.Formatter;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
@ -145,7 +146,7 @@ public class WeChatServiceImpl implements WeChatService {
|
|
|
|
|
* @return 微信二维码二进制
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public byte[] findWxCode(WeChatCodeRequest req) {
|
|
|
|
|
public String findWxCode(WeChatCodeRequest req) {
|
|
|
|
|
String accessToken = this.findAccessToken();
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
if (req.getWidth() != null) {
|
|
|
|
@ -154,6 +155,6 @@ public class WeChatServiceImpl implements WeChatService {
|
|
|
|
|
map.put("path", req.getPath() + "?shanghuId=" + req.getShanghuId());
|
|
|
|
|
String jsonStr = JSONUtil.toJsonStr(map);
|
|
|
|
|
String body = HttpUtil.post("https://api.weixin.qq.com/wxa/getwxacode?access_token=" + accessToken, jsonStr);
|
|
|
|
|
return body.getBytes();
|
|
|
|
|
return Base64.getEncoder().encodeToString(body.getBytes());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|