mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 11:05:18 +08:00
新增 青海平台配置信息
This commit is contained in:
@@ -32,7 +32,7 @@ import java.util.Map;
|
||||
*/
|
||||
@Anonymous
|
||||
@RestController
|
||||
@RequestMapping("/qinghai")
|
||||
@RequestMapping("/qinghai/evcs")
|
||||
public class QingHaiController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
@@ -74,6 +74,7 @@ public class QingHaiController extends BaseController {
|
||||
// 校验失败
|
||||
return CommonResult.failed("令牌校验错误");
|
||||
}
|
||||
|
||||
// 查询配置信息
|
||||
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(dto.getOperatorID());
|
||||
String operatorSecret = platformConfig.getOperatorSecret();
|
||||
@@ -81,6 +82,12 @@ public class QingHaiController extends BaseController {
|
||||
String dataSecret = platformConfig.getDataSecret();
|
||||
String dataSecretIV = platformConfig.getDataSecretIv();
|
||||
|
||||
// 校验签名
|
||||
boolean verifyResult = qingHaiPlatformServiceImpl.verifySignature(dto, platformConfig.getSignSecret());
|
||||
if (!verifyResult) {
|
||||
// 验签失败
|
||||
return CommonResult.failed("签名错误");
|
||||
}
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
@@ -116,6 +123,12 @@ public class QingHaiController extends BaseController {
|
||||
String dataSecret = platformConfig.getDataSecret();
|
||||
String dataSecretIV = platformConfig.getDataSecretIv();
|
||||
|
||||
// 校验签名
|
||||
boolean verifyResult = qingHaiPlatformServiceImpl.verifySignature(dto, platformConfig.getSignSecret());
|
||||
if (!verifyResult) {
|
||||
// 验签失败
|
||||
return CommonResult.failed("签名错误");
|
||||
}
|
||||
// 解密data
|
||||
byte[] plainText = Cryptos.aesDecrypt(Encodes.decodeBase64(dataString), dataSecret.getBytes(), dataSecretIV.getBytes());
|
||||
String dataStr = new String(plainText, StandardCharsets.UTF_8);
|
||||
|
||||
Reference in New Issue
Block a user