From 00c16bb2eacdff9e310607cb912a162c5ab0756f Mon Sep 17 00:00:00 2001 From: chengqf <584883665@139.com> Date: Tue, 18 Apr 2023 12:17:03 +0800 Subject: [PATCH] =?UTF-8?q?signleDownloadFile=E6=96=87=E4=BB=B6=E5=A4=A7?= =?UTF-8?q?=E4=BA=8E0=E8=BF=94=E5=9B=9E=E6=88=90=E5=8A=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/glxp/api/idc/service/impl/IdcServiceImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 522065a9..1ace5e40 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -1178,10 +1178,11 @@ public class IdcServiceImpl implements IdcService { .post(body) .addHeader("Content-Type", "application/x-www-form-urlencoded") .build(); + int total=0; try { Response result = client.newCall(request).execute(); String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; - int total = 0; + if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { try (InputStream inputStream = result.body().byteStream()) { @@ -1220,7 +1221,7 @@ public class IdcServiceImpl implements IdcService { e.printStackTrace(); } - return true; + return (total>0); } /*获取转发服务地址,当前值允许单向,只使用参数upper_server_ip*/