//update---author:wangshuai---date:2025-06-05---for:open api功能优化:ak接口返回未明确提示错误---

pull/8389/head
gj_wangshuai 2025-06-06 09:35:27 +08:00
parent 157877f9a6
commit 7a031e6135
1 changed files with 11 additions and 1 deletions

View File

@ -41,7 +41,17 @@ public class SampleOpenApiTest {
// 解析JSON响应
JSONObject res = JSON.parseObject(responseBody);
System.out.println("[info] 调用成功: " + res.toJSONString());
//错误日志判断
if(res.containsKey("success")){
Boolean success = res.getBoolean("success");
if(success){
System.out.println("[info] 调用成功: " + res.toJSONString());
}else{
System.out.println("[error] 调用失败: " + res.getString("message"));
}
}else{
System.out.println("[error] 调用失败: " + res.getString("message"));
}
}
}