diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java index 8e895898b..2ed702239 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/neimenggu/service/NeiMengGuPlatformServiceImpl.java @@ -128,13 +128,14 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { String operatorId = dto.getPlatformID(); // 通过operatorId 查出 operatorSecret ThirdPartyPlatformConfig platformConfig = thirdPartyPlatformConfigService.getInfoByOperatorId(operatorId); - if (platformConfig == null) { + ThirdPartySecretInfoVO thirdPartySecretInfoVO = thirdpartySecretInfoService.queryByOperatorId(operatorId); + if (thirdPartySecretInfoVO == null) { failReason = 1; succStat = 1; } else { - String operatorSecret = platformConfig.getOperatorSecret(); - String dataSecret = platformConfig.getDataSecret(); - String dataSecretIv = platformConfig.getDataSecretIv(); + String theirOperatorSecret = thirdPartySecretInfoVO.getTheirOperatorSecret(); + String dataSecret = thirdPartySecretInfoVO.getOurDataSecret(); + String dataSecretIv = thirdPartySecretInfoVO.getOurDataSecretIv(); // 解密data 获取参数中的OperatorSecret String decrypt = Cryptos.decrypt(dto.getData(), dataSecret, dataSecretIv); String inputOperatorSecret = null; @@ -142,12 +143,12 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { inputOperatorSecret = JSON.parseObject(decrypt).getString("PlatformSecret"); } // 对比密钥 - if (!StringUtils.equals(operatorSecret, inputOperatorSecret)) { + if (!StringUtils.equals(theirOperatorSecret, inputOperatorSecret)) { failReason = 1; succStat = 1; } else { // 生成token - String token = JWTUtils.createToken(operatorId, operatorSecret, JWTUtils.ttlMillis); + String token = JWTUtils.createToken(operatorId, theirOperatorSecret, JWTUtils.ttlMillis); vo.setAccessToken(token); vo.setTokenAvailableTime((int) (JWTUtils.ttlMillis / 1000)); } @@ -157,7 +158,7 @@ public class NeiMengGuPlatformServiceImpl implements ThirdPartyPlatformService { vo.setFailReason(failReason); vo.setSuccStat(succStat); - Map resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, platformConfig); + Map resultMap = ThirdPartyPlatformUtils.generateResultMap(vo, thirdPartySecretInfoVO); return resultMap; }