uft-8 改为 StandardCharsets.UTF_8

This commit is contained in:
2023-12-15 16:06:21 +08:00
parent ff9f4faecb
commit 517320e714
11 changed files with 33 additions and 25 deletions

View File

@@ -862,7 +862,7 @@ public class LianLianServiceImpl implements LianLianService {
String dataJson = JSONUtil.toJsonStr(data);
// 加密
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes("UTF-8"),
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes(StandardCharsets.UTF_8),
dataSecret.getBytes(), dataSecretIv.getBytes());
String strData = Encodes.encodeBase64(encryptText);
@@ -886,7 +886,7 @@ public class LianLianServiceImpl implements LianLianService {
// 解密data
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64((String) result.getData()),
dataSecret.getBytes(), dataSecretIv.getBytes());
String dataStr = new String(plainText, "UTF-8");
String dataStr = new String(plainText, StandardCharsets.UTF_8);
Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
token = resultMap.get("AccessToken");
// logger.info("token: {}", token);
@@ -1616,7 +1616,7 @@ public class LianLianServiceImpl implements LianLianService {
String dataString = checkResultMap.get("Data");
// 解密data
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIv.getBytes());
String dataStr = new String(plainText, "UTF-8");
String dataStr = new String(plainText, StandardCharsets.UTF_8);
Map<String, String> resMap = (Map<String, String>) JSON.parse(dataStr);
String secret = resMap.get("OperatorSecret");