mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 19:15:35 +08:00
update query_token
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.jsowell.thirdparty.platform.zhongdianlian.service;
|
package com.jsowell.thirdparty.platform.zhongdianlian.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.util.JWTUtils;
|
import com.jsowell.common.util.JWTUtils;
|
||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
@@ -16,6 +17,7 @@ import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -55,7 +57,6 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
|
|||||||
|
|
||||||
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
|
String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID();
|
||||||
// 通过operatorId 查出 operatorSecret
|
// 通过operatorId 查出 operatorSecret
|
||||||
// ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId);
|
|
||||||
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId);
|
||||||
if (thirdPartySecretInfoVO == null) {
|
if (thirdPartySecretInfoVO == null) {
|
||||||
failReason = 1;
|
failReason = 1;
|
||||||
@@ -68,10 +69,14 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi
|
|||||||
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv);
|
||||||
String inputOperatorSecret = null;
|
String inputOperatorSecret = null;
|
||||||
if (StringUtils.isNotBlank(decrypt)) {
|
if (StringUtils.isNotBlank(decrypt)) {
|
||||||
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
inputOperatorSecret = JSON.parseObject(decrypt).getString("OperatorSecret");
|
||||||
|
if (StringUtils.isBlank(inputOperatorSecret)) {
|
||||||
|
inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 对比密钥
|
// 对比密钥
|
||||||
if (!StringUtils.equals(theirOperatorSecret, inputOperatorSecret)) {
|
List<String> operatorSecretList = Lists.newArrayList(theirOperatorSecret, thirdPartySecretInfoVO.getOurOperatorSecret());
|
||||||
|
if (!operatorSecretList.contains(inputOperatorSecret)) {
|
||||||
failReason = 1;
|
failReason = 1;
|
||||||
succStat = 1;
|
succStat = 1;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user