mirror of
https://gitee.com/dromara/sms4j.git
synced 2025-12-06 08:58:38 +08:00
修改腾讯短信Success返回值判断修复
This commit is contained in:
parent
e7c7655e31
commit
2861cf4f00
@ -118,7 +118,12 @@ public class TencentSmsImpl extends AbstractSmsBlend<TencentConfig> {
|
||||
private SmsResponse getResponse(JSONObject resJson) {
|
||||
SmsResponse smsResponse = new SmsResponse();
|
||||
JSONObject response = resJson.getJSONObject("Response");
|
||||
// 根据 Error 判断是否配置错误
|
||||
String error = response.getStr("Error");
|
||||
smsResponse.setSuccess(StrUtil.isBlank(error));
|
||||
// 根据 SendStatusSet 判断是否不为Ok
|
||||
JSONArray sendStatusSet = response.getJSONArray("SendStatusSet");
|
||||
if (sendStatusSet != null) {
|
||||
boolean success = true;
|
||||
for (Object obj : sendStatusSet) {
|
||||
JSONObject jsonObject = (JSONObject) obj;
|
||||
@ -129,6 +134,7 @@ public class TencentSmsImpl extends AbstractSmsBlend<TencentConfig> {
|
||||
}
|
||||
}
|
||||
smsResponse.setSuccess(success);
|
||||
}
|
||||
smsResponse.setData(resJson);
|
||||
smsResponse.setConfigId(getConfigId());
|
||||
return smsResponse;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user