From 88ceb8a9e72f51a4d0ff2cf84b86f1e57ab4394b Mon Sep 17 00:00:00 2001 From: andy <1042025947@qq.com> Date: Wed, 9 Apr 2025 13:23:36 +0800 Subject: [PATCH] =?UTF-8?q?1=20=E4=BC=98=E5=8C=96=E5=A4=84=E7=90=86token?= =?UTF-8?q?=E6=97=A0=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evotech/hd/wechat/service/impl/LoginServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wechat-server/src/main/java/com/evotech/hd/wechat/service/impl/LoginServiceImpl.java b/wechat-server/src/main/java/com/evotech/hd/wechat/service/impl/LoginServiceImpl.java index b0efe35..1a5d73b 100644 --- a/wechat-server/src/main/java/com/evotech/hd/wechat/service/impl/LoginServiceImpl.java +++ b/wechat-server/src/main/java/com/evotech/hd/wechat/service/impl/LoginServiceImpl.java @@ -98,7 +98,13 @@ public class LoginServiceImpl implements LoginService { String res = LoginUtil.checkSessionKey(accessTokenService.getAccessToken(), openid, hmac.digestHex("")); JSONObject jo = JSONUtil.parseObj(res); if (jo.getInt("errcode") == 0) { - Map m = tokenBuilder(wuid); + //Map m = tokenBuilder(wuid); + String wxToken= String.valueOf(redisUtil.get(HDConstant.wxToken + wuid)); + //刷新token的过期时间 + redisUtil.set(HDConstant.wxToken + wuid, wxToken, tokenExpHour * 3600L); + Map m = new HashMap(); + m.put("wuid", wuid); + m.put("wxToken", wxToken); return new Result>().success(m); } return new Result>().error(CodeMsg.WECHAT_SERRION_ERROR, jo);