mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
update 联联平台接口校验令牌
This commit is contained in:
@@ -233,18 +233,18 @@ public class SpringBootTestController {
|
||||
String operatorId = "I4XLPQPV";
|
||||
String operatorSecret = "3DSBTWHVIC6KVCKI";
|
||||
// 请求data
|
||||
// Map<String, String> data = new HashMap<>();
|
||||
// data.put("OperatorID", operatorId);
|
||||
// data.put("OperatorSecret", operatorSecret);
|
||||
// String dataJson = JSONUtil.toJsonStr(data);
|
||||
Map<String, String> data = new HashMap<>();
|
||||
data.put("OperatorID", operatorId);
|
||||
data.put("OperatorSecret", operatorSecret);
|
||||
String dataJson = JSONUtil.toJsonStr(data);
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
// JSONObject json = new JSONObject();
|
||||
// json.put("StationIDs", com.google.common.collect.Lists.newArrayList("1", "2"));
|
||||
json.put("StationID", "2");
|
||||
json.put("StartTime", "2023-02-01");
|
||||
json.put("EndTime", "2023-06-01");
|
||||
// json.put("StationID", "2");
|
||||
// json.put("StartTime", "2023-02-01");
|
||||
// json.put("EndTime", "2023-06-01");
|
||||
|
||||
String dataJson = JSONObject.toJSONString(json);
|
||||
// String dataJson = JSONObject.toJSONString(json);
|
||||
// 加密
|
||||
byte[] encryptText = Cryptos.aesEncrypt(dataJson.getBytes("UTF-8"),
|
||||
operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
@@ -270,12 +270,13 @@ public class SpringBootTestController {
|
||||
// Map<String, String> map = lianLianService.generateToken(dto);
|
||||
// String data1 = map.get("Data");
|
||||
// // 解密data
|
||||
// byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||||
// operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
// String dataStr = new String(plainText, "UTF-8");
|
||||
// Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||||
// String token = resultMap.get("AccessToken");
|
||||
// System.out.println("解密后token:" + token);
|
||||
String data1 = "JudlP17tnYuQc2zwOzmjJAb9hgghIymefG5v3ZzSOlOzRL6QcXMa5C5dy8acL2ZWEw5DOc0D3G2qSLsqBCZ9ft/8akGVLL0N4keLV9ipS2REJx1dvm1m4l9ONIP9czNeDTxUsS0b1aCkkxgn7OVYD+ch+yLH/3dMATb32aEjggGY31lu/S2vB+f2aO+icJ2EyAkakB8Huowb3ancZVs/sxCFbVZUmUyo6WEyLtfcn3moKwD52CWoECRgK7lUjBs3F8VKcMT/dTeSKEgZM3Z7/wrEzljKL4519XKyL2lYgJ3h/ewFDRZcnTIJAWskfiKnacZF7yZUTYj13h+sI9wrYmgT2ScqDCQVUI40gDnpewU=";
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(data1),
|
||||
operatorSecret.getBytes(), operatorSecret.getBytes());
|
||||
String dataStr = new String(plainText, "UTF-8");
|
||||
Map<String, String> resultMap = (Map<String, String>) JSON.parse(dataStr);
|
||||
String token = resultMap.get("AccessToken");
|
||||
System.out.println("解密后token:" + token);
|
||||
|
||||
|
||||
// LianLianPushStationInfoDTO dto1 = LianLianPushStationInfoDTO.builder()
|
||||
@@ -315,6 +316,12 @@ public class SpringBootTestController {
|
||||
|
||||
// 推送订单对账结果信息
|
||||
// lianLianService.pushOrderReconciliationInfo("C27680791529");
|
||||
|
||||
// 测试生成、解密令牌
|
||||
// long ttlMillis = 60 * 60 * 24 * 1000;
|
||||
// String token = JWTUtils.createToken(operatorId, operatorSecret, ttlMillis);
|
||||
// System.out.println(JWTUtils.checkThirdPartyToken(token));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user