commit
This commit is contained in:
@@ -143,12 +143,15 @@ public class SmsNcuServiceImpl implements SmsService {
|
||||
String body = HttpUtil.createPost(SEND_MSG_URL)
|
||||
.header("Authorization", token)
|
||||
.header("Content-Type", "application/json")
|
||||
.form(params).execute().body();
|
||||
.body(Json.toJson(params)).execute().body();
|
||||
JSONObject resultJsonBody = JSONUtil.parseObj(body);
|
||||
log.info("【log】发送消息通知,接口响应数据:{}", body);
|
||||
|
||||
if (resultJsonBody.getInt("code") == 0) {
|
||||
log.info("【log】发送消息通知成功");
|
||||
JSONObject data = resultJsonBody.getJSONObject("data");
|
||||
String sendId = data.getStr("sendId");
|
||||
System.out.println(sendId);
|
||||
} else {
|
||||
log.info("【log】发送消息通知失败:{}", resultJsonBody.getStr("message"));
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class SmsTokenUtil {
|
||||
|
||||
JSONObject resultJsonBody = JSONUtil.parseObj(body);
|
||||
log.info("【log】获取消息token接口回调数据:{}", Json.toJson(resultJsonBody));
|
||||
if (resultJsonBody.getInt("code") == 200) {
|
||||
if (StrUtil.isNotBlank(resultJsonBody.getStr("access_token"))) {
|
||||
String accessToken = resultJsonBody.getStr("access_token");
|
||||
Integer expiresIn = resultJsonBody.getInt("expires_in");
|
||||
redisService.setex(key, expiresIn, accessToken);
|
||||
|
||||
Reference in New Issue
Block a user