From f89b9b493afa1f4b933253ab474caf09b3489f18 Mon Sep 17 00:00:00 2001 From: CZT <czt18638530771@163.com> Date: 星期四, 28 十二月 2023 17:20:36 +0800 Subject: [PATCH] 上海嘉定纪委接口调整4 --- src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java | 18 ++++++++++-------- 1 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java b/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java index d43370f..438c5b2 100644 --- a/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java +++ b/src/main/java/com/fzzy/push/shjdjw2023/Shjdjw2023HttpClientUtil.java @@ -32,7 +32,7 @@ HttpURLConnection connection = null; OutputStream outputStream = null; String rs = ""; - ShjdjwRespDto responseDto; + ShjdjwRespDto responseDto = null; try { connection = (HttpURLConnection) urls.openConnection(); connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); @@ -68,15 +68,17 @@ rs = null; return new ShjdjwRespDto(99,e.getMessage()); } - log.info("---------鎺ュ彛杩斿洖锛�" + rs +"---------"); - if(StringUtils.isEmpty(rs)){ + if(StringUtils.isNotEmpty(rs)){ + rs = rs.replaceAll("\"", ""); + log.info("---------鎺ュ彛杩斿洖锛岀鏂囷細" + rs +"---------"); + rs = AESUtils.decrypt(rs, apiConfs.getPublicKey()); + log.info("---------鎺ュ彛杩斿洖锛岃В鏋愬悗锛�" + rs +"---------"); + responseDto = JSON.parseObject(rs, ShjdjwRespDto.class); + } + if(responseDto == null ) { return new ShjdjwRespDto(99,"鎺ュ彛璇锋眰鍙戠敓鏈煡閿欒"); } - if("dDTJ5xGqsmo32r40WKKPOLW6ORtH3mwMyv4YaJNzc4g=".equals(rs)){ - return new ShjdjwRespDto(1,"涓婃姤鎴愬姛"); - } -// responseDto = JSON.parseObject(rs, ShjdjwRespDto.class); - return new ShjdjwRespDto(1,"涓婃姤鎴愬姛"); + return responseDto; } finally { try { outputStream.close(); -- Gitblit v1.9.3