From 24528b8699dda30cf6ebe0d1a9c6e0b71ab4a658 Mon Sep 17 00:00:00 2001 From: Lemon Date: Thu, 2 Jan 2025 09:33:33 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E7=AC=AC=E4=B8=89=E6=96=B9?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E8=8E=B7=E5=8F=96token=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=B0=86token=E5=AD=98=E5=85=A5=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platform/service/ThirdPartyPlatformService.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java index afc905b3d..b5a0c39b4 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/ThirdPartyPlatformService.java @@ -493,9 +493,11 @@ public interface ThirdPartyPlatformService extends InitializingBean { String dataStr = new String(plainText, StandardCharsets.UTF_8); Map resultMap = (Map) JSON.parse(dataStr); token = String.valueOf(resultMap.get("AccessToken")); - int tokenAvailableTime = Integer.parseInt(String.valueOf(resultMap.get("TokenAvailableTime"))); - // 将token存入缓存 - redisCache.setCacheObject(tokenKey, token, tokenAvailableTime, TimeUnit.SECONDS); + if (resultMap.get("TokenAvailableTime") != null) { + int tokenAvailableTime = Integer.parseInt(String.valueOf(resultMap.get("TokenAvailableTime"))); + // 将token存入缓存 + redisCache.setCacheObject(tokenKey, token, tokenAvailableTime, TimeUnit.SECONDS); + } // logger.info("token: {}", token); } // logger.info("获取令牌 result:{}, token: {}", result, token);