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 ++++++++++--------
 src/main/resources/application-pro2.yml                              |    2 +-
 2 files changed, 11 insertions(+), 9 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();
diff --git a/src/main/resources/application-pro2.yml b/src/main/resources/application-pro2.yml
index f2e896b..77520d5 100644
--- a/src/main/resources/application-pro2.yml
+++ b/src/main/resources/application-pro2.yml
@@ -38,7 +38,7 @@
           dialect: org.hibernate.dialect.MySQL5InnoDBDialect
   # Redis鐩稿叧閰嶇疆
   redis:
-    database: 1
+    database: 10
     host: 127.0.0.1
     port: 6379
     password: Abc123..

--
Gitblit v1.9.3