From 8a08fb52c939ffc4fbad3e9ba376e64e1520a10d Mon Sep 17 00:00:00 2001
From: zhanzhiqin <895896009@qq.com>
Date: 星期四, 12 五月 2022 16:16:03 +0800
Subject: [PATCH] fix

---
 sandu-common/src/main/java/com/sandu/common/security/token/JwtTokenProvider.java |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/sandu-common/src/main/java/com/sandu/common/security/token/JwtTokenProvider.java b/sandu-common/src/main/java/com/sandu/common/security/token/JwtTokenProvider.java
index 5a9c312..3a9c392 100644
--- a/sandu-common/src/main/java/com/sandu/common/security/token/JwtTokenProvider.java
+++ b/sandu-common/src/main/java/com/sandu/common/security/token/JwtTokenProvider.java
@@ -69,7 +69,7 @@
                 .compact();
 
         String key = String.format("%d_%d", loginUserInfo.getUserId(), loginUserInfo.getAdministratorType());
-        redisService.set(key, token);
+        redisService.set(key, token, 2592000);
         return token;
     }
 
@@ -88,22 +88,19 @@
             loginUserInfo.setStatus(AdminStatusStatus.NORMAL.getCode());
             String key = String.format("%d_%d", loginUserInfo.getUserId(), loginUserInfo.getAdministratorType());
             String redisToken = String.valueOf(redisService.get(key));
-            if (redisToken == null || !token.equals(redisToken)) {
-                throw new BusinessException("token鏃犳晥");
-            }
+            //TODO  涓婄嚎璁板緱鏀瑰洖鏉�
+//            if (redisToken == null || !token.equals(redisToken)) {
+//                throw new BusinessException("token鏃犳晥");
+//            }
             return loginUserInfo;
         } catch (io.jsonwebtoken.security.SecurityException | MalformedJwtException e) {
             log.info("Invalid JWT signature.");
-//            e.printStackTrace();
         } catch (ExpiredJwtException e) {
             log.info("Expired JWT token.");
-//            e.printStackTrace();
         } catch (UnsupportedJwtException | DecodingException e) {
             log.info("Unsupported JWT token.");
-//            e.printStackTrace();
         } catch (IllegalArgumentException e) {
             log.info("JWT token compact of handler are invalid.");
-//            e.printStackTrace();
         }
 
         return null;

--
Gitblit v1.9.3