From 4eabd24c49008bfabbe75d933b67bb07988509c2 Mon Sep 17 00:00:00 2001 From: zoujiangtao Date: Tue, 3 Dec 2024 17:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=BA=EF=BC=9A=E9=82=B9?= =?UTF-8?q?=E6=B1=9F=E6=B6=9B=20=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=9AAPI=E6=98=A0=E5=B0=84=E5=85=AC=E5=85=B1=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=20=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4=EF=BC=9A2024/1?= =?UTF-8?q?2/03?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/shkd/sys/sys/mservice/ApiService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java index 49d8394..dd1344e 100644 --- a/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java +++ b/sys/shkd-sys-sys/src/main/java/shkd/sys/sys/mservice/ApiService.java @@ -54,8 +54,8 @@ public class ApiService { try { // 发送请求 Request request = buildRequest(urlString); - logger.info("getBIPToken → 获取返回数据:{}", request); Response response = client.newCall(request).execute(); + logger.info("getBIPToken → 获取返回数据:{}", response); token = handleResponse(response); } catch (Exception e) { logger.error("getBIPToken → 请求失败: ", e); @@ -76,7 +76,7 @@ public class ApiService { private static String handleResponse(Response response) throws IOException { if (response.isSuccessful()) { - String responseBody = response.body().toString(); + String responseBody = response.body().string(); logger.info("handleResponse → 响应内容: {}", responseBody); JSONObject jsonObject = JSONObject.parseObject(responseBody); JSONObject data = jsonObject.getJSONObject("data");