修改人:邹江涛

修改内容:API映射公共单据
修改时间:2024/12/03
This commit is contained in:
zoujiangtao 2024-12-03 17:04:19 +08:00
parent 8c7c439c4e
commit 4eabd24c49
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ public class ApiService {
try { try {
// 发送请求 // 发送请求
Request request = buildRequest(urlString); Request request = buildRequest(urlString);
logger.info("getBIPToken → 获取返回数据:{}", request);
Response response = client.newCall(request).execute(); Response response = client.newCall(request).execute();
logger.info("getBIPToken → 获取返回数据:{}", response);
token = handleResponse(response); token = handleResponse(response);
} catch (Exception e) { } catch (Exception e) {
logger.error("getBIPToken → 请求失败: ", e); logger.error("getBIPToken → 请求失败: ", e);
@ -76,7 +76,7 @@ public class ApiService {
private static String handleResponse(Response response) throws IOException { private static String handleResponse(Response response) throws IOException {
if (response.isSuccessful()) { if (response.isSuccessful()) {
String responseBody = response.body().toString(); String responseBody = response.body().string();
logger.info("handleResponse → 响应内容: {}", responseBody); logger.info("handleResponse → 响应内容: {}", responseBody);
JSONObject jsonObject = JSONObject.parseObject(responseBody); JSONObject jsonObject = JSONObject.parseObject(responseBody);
JSONObject data = jsonObject.getJSONObject("data"); JSONObject data = jsonObject.getJSONObject("data");