diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/zhongdianlian/service/ZhongDianLianPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/zhongdianlian/service/ZhongDianLianPlatformServiceImpl.java index a60c11368..acbe61dc3 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/zhongdianlian/service/ZhongDianLianPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/zhongdianlian/service/ZhongDianLianPlatformServiceImpl.java @@ -1,6 +1,7 @@ package com.jsowell.thirdparty.platform.zhongdianlian.service; import com.alibaba.fastjson2.JSON; +import com.google.common.collect.Lists; import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum; import com.jsowell.common.util.JWTUtils; 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.stereotype.Service; +import java.util.List; import java.util.Map; @Service @@ -55,7 +57,6 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi String operatorId = StringUtils.isNotBlank(dto.getOperatorID()) ? dto.getOperatorID() : dto.getPlatformID(); // 通过operatorId 查出 operatorSecret - // ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId); ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId); if (thirdPartySecretInfoVO == null) { failReason = 1; @@ -68,10 +69,14 @@ public class ZhongDianLianPlatformServiceImpl implements ThirdPartyPlatformServi String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv); String inputOperatorSecret = null; 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 operatorSecretList = Lists.newArrayList(theirOperatorSecret, thirdPartySecretInfoVO.getOurOperatorSecret()); + if (!operatorSecretList.contains(inputOperatorSecret)) { failReason = 1; succStat = 1; } else {