json 2
This commit is contained in:
parent
e491d77e65
commit
370555aa66
|
|
@ -55,16 +55,17 @@ public class AcAccountUtil {
|
|||
log.error("获取 access_token 失败");
|
||||
return "";
|
||||
}
|
||||
JSONObject bodyJson = new JSONObject();
|
||||
//二维码有效时间(秒),最大2592000,仅临时二维码需要
|
||||
bodyJson.put("expire_seconds", "2592000");
|
||||
//二维码类型:QR_SCENE(临时整型)/QR_STR_SCENE(临时字符串)/QR_LIMIT_SCENE(永久整型)/QR_LIMIT_STR_SCENE(永久字符串)
|
||||
bodyJson.put("action_name", "QR_STR_SCENE");
|
||||
JSONObject actionInfo = new JSONObject();
|
||||
JSONObject scene = new JSONObject();
|
||||
scene.put("scene_str", userId.toString());
|
||||
actionInfo.put("scene", scene);
|
||||
bodyJson.put("action_info", actionInfo);
|
||||
String bodyJson = "{\"action_info\":{\"scene\":{\"scene_str\":\"10839\"}},\"action_name\":\"QR_STR_SCENE\",\"expire_seconds\":\"2592000\"}";
|
||||
// JSONObject bodyJson = new JSONObject();
|
||||
// //二维码有效时间(秒),最大2592000,仅临时二维码需要
|
||||
// bodyJson.put("expire_seconds", "2592000");
|
||||
// //二维码类型:QR_SCENE(临时整型)/QR_STR_SCENE(临时字符串)/QR_LIMIT_SCENE(永久整型)/QR_LIMIT_STR_SCENE(永久字符串)
|
||||
// bodyJson.put("action_name", "QR_STR_SCENE");
|
||||
// JSONObject actionInfo = new JSONObject();
|
||||
// JSONObject scene = new JSONObject();
|
||||
// scene.put("scene_str", userId.toString());
|
||||
// actionInfo.put("scene", scene);
|
||||
// bodyJson.put("action_info", actionInfo);
|
||||
String url = StrUtil.format("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={}", accessToken);
|
||||
String resp = HttpUtil.post(url, bodyJson);
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue