From 04e9ecce235e7b33a68ef66394c00c29082ecada Mon Sep 17 00:00:00 2001 From: Guoqs Date: Mon, 22 Apr 2024 15:27:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AF=B9=E6=8E=A5=E5=86=85=E8=92=99?= =?UTF-8?q?=E5=8F=A4=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/NeiMengGuPlatformServiceImpl.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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; }