From 73c489ee33a76dd8c7b4a97177bc466e9cdcd6a7 Mon Sep 17 00:00:00 2001 From: Guoqs Date: Wed, 27 Mar 2024 15:52:32 +0800 Subject: [PATCH] =?UTF-8?q?lianlianService=E4=BD=BF=E7=94=A8=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E5=8A=A0=E5=AF=86=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/ThirdPartyPlatformService.java | 7 +++--- .../service/LianLianPlatformServiceImpl.java | 22 +++---------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/ThirdPartyPlatformService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/ThirdPartyPlatformService.java index c50cbfd78..211ce3a50 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/ThirdPartyPlatformService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/ThirdPartyPlatformService.java @@ -420,9 +420,10 @@ public interface ThirdPartyPlatformService { Map resultMap = Maps.newLinkedHashMap(); // 加密数据 - byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(vo).getBytes(), - dataSecret.getBytes(), dataSecretIv.getBytes()); - String encryptData = Encodes.encodeBase64(encryptText); + // byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(vo).getBytes(), + // dataSecret.getBytes(), dataSecretIv.getBytes()); + // String encryptData = Encodes.encodeBase64(encryptText); + String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(vo), dataSecret, dataSecretIv); resultMap.put("Data", encryptData); // 生成sig diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java index e15196c10..50833f9ce 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/lianlian/service/LianLianPlatformServiceImpl.java @@ -29,7 +29,6 @@ import com.jsowell.pile.vo.uniapp.BillingPriceVO; import com.jsowell.pile.vo.web.PileStationVO; import com.jsowell.thirdparty.lianlian.domain.*; import com.jsowell.thirdparty.lianlian.util.Cryptos; -import com.jsowell.thirdparty.lianlian.util.Encodes; import com.jsowell.thirdparty.lianlian.util.GBSignUtils; import com.jsowell.thirdparty.lianlian.util.HttpRequestUtil; import com.jsowell.thirdparty.platform.ThirdPartyPlatformService; @@ -174,18 +173,13 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { map.put("ItemSize", resultList.size()); map.put("StationInfos", resultList); - // 加密 Map resultMap = Maps.newLinkedHashMap(); // 加密数据 - byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), - configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); - String encryptData = Encodes.encodeBase64(encryptText); - + String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(map), configInfo.getDataSecret(), configInfo.getDataSecretIv()); resultMap.put("Data", encryptData); // 生成sig String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); resultMap.put("Sig", resultSign); - return resultMap; } @@ -266,18 +260,13 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { map.put("Total", total); map.put("StationStatusInfos", collect); - // 加密 Map resultMap = Maps.newLinkedHashMap(); // 加密数据 - byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), - configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); - String encryptData = Encodes.encodeBase64(encryptText); - + String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(map), configInfo.getDataSecret(), configInfo.getDataSecretIv()); resultMap.put("Data", encryptData); // 生成sig String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); resultMap.put("Sig", resultSign); - return resultMap; } @@ -365,18 +354,13 @@ public class LianLianPlatformServiceImpl implements ThirdPartyPlatformService { Map map = new LinkedHashMap<>(); map.put("StationStats", stationStatsInfo); - // 加密 Map resultMap = Maps.newLinkedHashMap(); // 加密数据 - byte[] encryptText = Cryptos.aesEncrypt(JSON.toJSONString(map).getBytes(), - configInfo.getDataSecret().getBytes(), configInfo.getDataSecretIv().getBytes()); - String encryptData = Encodes.encodeBase64(encryptText); - + String encryptData = Cryptos.aesEncrypt(JSON.toJSONString(map), configInfo.getDataSecret(), configInfo.getDataSecretIv()); resultMap.put("Data", encryptData); // 生成sig String resultSign = GBSignUtils.sign(resultMap, configInfo.getSignSecret()); resultMap.put("Sig", resultSign); - return resultMap; }