token
This commit is contained in:
@@ -64,8 +64,8 @@ public class AcAccountUtil {
|
|||||||
scene.put("scene_str", userId.toString());
|
scene.put("scene_str", userId.toString());
|
||||||
actionInfo.put("scene", scene);
|
actionInfo.put("scene", scene);
|
||||||
bodyJson.put("action_info", actionInfo);
|
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(StrUtil.format("https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token={}", accessToken), bodyJson);
|
String resp = HttpUtil.post(url, bodyJson);
|
||||||
/**
|
/**
|
||||||
* {
|
* {
|
||||||
* "ticket": "gQH47joAAAAAAAAAASxodHRwOi8vd2VpeGlu...",
|
* "ticket": "gQH47joAAAAAAAAAASxodHRwOi8vd2VpeGlu...",
|
||||||
@@ -75,7 +75,7 @@ public class AcAccountUtil {
|
|||||||
*/
|
*/
|
||||||
JSONObject respInfo = JSONObject.parseObject(resp);
|
JSONObject respInfo = JSONObject.parseObject(resp);
|
||||||
if (respInfo.get("url") == null) {
|
if (respInfo.get("url") == null) {
|
||||||
log.error("创建临时二维码失败,发送参数: {}, 响应内容: {}", bodyJson, resp);
|
log.error("创建临时二维码失败,发送参数:url:{}, {}, 响应内容: {}", url, bodyJson, resp);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return respInfo.get("url").toString();
|
return respInfo.get("url").toString();
|
||||||
@@ -83,7 +83,7 @@ public class AcAccountUtil {
|
|||||||
|
|
||||||
|
|
||||||
public String getAccessToken() {
|
public String getAccessToken() {
|
||||||
String accessToken = Convert.toStr(redisService.get("wx:ac:AccessToken"));
|
String accessToken = redisService.get("wx:ac:AccessToken").toString();
|
||||||
if (StrUtil.isNotEmpty(accessToken)) {
|
if (StrUtil.isNotEmpty(accessToken)) {
|
||||||
return accessToken;
|
return accessToken;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user