From fe729234647c83f8029beba4e31dc8d364a6427b Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期三, 27 八月 2025 16:04:35 +0800
Subject: [PATCH] 修BUG
---
server/services/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java b/server/services/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java
index f1e4399..47d22e5 100644
--- a/server/services/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java
+++ b/server/services/src/main/java/com/doumee/config/jwt/JwtTokenUtil.java
@@ -76,7 +76,9 @@
public void refreshToken(String token,Member member) {
try {
if(Objects.nonNull(member)){
- redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
+ redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
+// redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token);
+// redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
}
} catch (Exception e) {
@@ -112,7 +114,8 @@
.setExpiration(expirationDate)
.signWith(SignatureAlgorithm.HS512, jwtProperties.getSecret())
.compact();
- redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
+ redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),
+ jwtProperties.getExpiration(), TimeUnit.MILLISECONDS);
return token;
}
--
Gitblit v1.9.3