lianlianService使用新的加密方法

This commit is contained in:
2024-03-27 15:52:32 +08:00
parent b994f7047d
commit 73c489ee33
2 changed files with 7 additions and 22 deletions

View File

@@ -420,9 +420,10 @@ public interface ThirdPartyPlatformService {
Map<String, String> 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

View File

@@ -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<String, String> 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<String, String> 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<String, Object> map = new LinkedHashMap<>();
map.put("StationStats", stationStatsInfo);
// 加密
Map<String, String> 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;
}