浏览代码

[update] message:1.token缓存时间调整

kelei 6 月之前
父节点
当前提交
4b51aae871
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      admin/src/main/java/com/flyer/foster/util/WeChatApiUtil.java

+ 1 - 1
admin/src/main/java/com/flyer/foster/util/WeChatApiUtil.java

@@ -101,7 +101,7 @@ public class WeChatApiUtil {
                 res = restTemplate.getForObject(url, JSONObject.class, map);
                 // token失效时间
                 Integer expires = res.getInteger("expires_in");
-                long cacheExpires = LocalDateTime.now().plusSeconds(expires - 100).toEpochSecond(ZoneOffset.of("+8"));
+                long cacheExpires = expires - 100;
                 accessToken = res.getString("access_token");
                 redisUtil.set(RedisKeyConst.WECHAT_ACCESS_TOKEN_KEY + appId, accessToken, cacheExpires);
             } catch (RestClientException e) {