1 优化处理token无效问题

This commit is contained in:
andy 2025-04-09 13:23:36 +08:00
parent 52c5533043
commit 88ceb8a9e7

View File

@ -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<String, String> m = tokenBuilder(wuid);
//Map<String, String> m = tokenBuilder(wuid);
String wxToken= String.valueOf(redisUtil.get(HDConstant.wxToken + wuid));
//刷新token的过期时间
redisUtil.set(HDConstant.wxToken + wuid, wxToken, tokenExpHour * 3600L);
Map<String, String> m = new HashMap<String, String>();
m.put("wuid", wuid);
m.put("wxToken", wxToken);
return new Result<Map<String, String>>().success(m);
}
return new Result<Map<String, String>>().error(CodeMsg.WECHAT_SERRION_ERROR, jo);