mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 03:39:55 +08:00
update 对接内蒙古平台
This commit is contained in:
@@ -128,13 +128,14 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
String operatorId = dto.getPlatformID();
|
String operatorId = dto.getPlatformID();
|
||||||
// 通过operatorId 查出 operatorSecret
|
// 通过operatorId 查出 operatorSecret
|
||||||
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
|
ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
|
||||||
if (platformConfig == null) {
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
||||||
|
if (thirdPartySecretInfoVO == null) {
|
||||||
failReason = 1;
|
failReason = 1;
|
||||||
succStat = 1;
|
succStat = 1;
|
||||||
} else {
|
} else {
|
||||||
String operatorSecret = platformConfig.getOperatorSecret();
|
String theirOperatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret();
|
||||||
String dataSecret = platformConfig.getDataSecret();
|
String dataSecret = thirdPartySecretInfoVO.getOurDataSecret();
|
||||||
String dataSecretIv = platformConfig.getDataSecretIv();
|
String dataSecretIv = thirdPartySecretInfoVO.getOurDataSecretIv();
|
||||||
// 解密data 获取参数中的OperatorSecret
|
// 解密data 获取参数中的OperatorSecret
|
||||||
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
||||||
String inputOperatorSecret = null;
|
String inputOperatorSecret = null;
|
||||||
@@ -142,12 +143,12 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
||||||
}
|
}
|
||||||
// 对比密钥
|
// 对比密钥
|
||||||
if (!StringUtils.equals(operatorSecret, inputOperatorSecret)) {
|
if (!StringUtils.equals(theirOperatorSecret, inputOperatorSecret)) {
|
||||||
failReason = 1;
|
failReason = 1;
|
||||||
succStat = 1;
|
succStat = 1;
|
||||||
} else {
|
} else {
|
||||||
// 生成token
|
// 生成token
|
||||||
String token = JWTUtils.createToken(operatorId, operatorSecret, JWTUtils.ttlMillis);
|
String token = JWTUtils.createToken(operatorId, theirOperatorSecret, JWTUtils.ttlMillis);
|
||||||
vo.setAccessToken(token);
|
vo.setAccessToken(token);
|
||||||
vo.setTokenAvailableTime((int) (JWTUtils.ttlMillis / 1000));
|
vo.setTokenAvailableTime((int) (JWTUtils.ttlMillis / 1000));
|
||||||
}
|
}
|
||||||
@@ -157,7 +158,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService {
|
|||||||
vo.setFailReason(failReason);
|
vo.setFailReason(failReason);
|
||||||
vo.setSuccStat(succStat);
|
vo.setSuccStat(succStat);
|
||||||
|
|
||||||
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, platformConfig);
|
Map<String, String> resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO);
|
||||||
return resultMap;
|
return resultMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user