From 93fe0b66e85e95e3a7e77a28504d6d289b6906b9 Mon Sep 17 00:00:00 2001
From: kaiyu <404897439@qq.com>
Date: Fri, 08 Oct 2021 13:11:22 +0800
Subject: [PATCH] screen-manage screen-api      更改拦截器逻辑,记录token无效的请求IP以及URL。      manage记录到数据库日志中      api记录在日志文件中

---
 screen-common/src/main/java/com/moral/util/TokenUtils.java |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/screen-common/src/main/java/com/moral/util/TokenUtils.java b/screen-common/src/main/java/com/moral/util/TokenUtils.java
index e580762..d82f09e 100644
--- a/screen-common/src/main/java/com/moral/util/TokenUtils.java
+++ b/screen-common/src/main/java/com/moral/util/TokenUtils.java
@@ -85,7 +85,7 @@
      * @Author: ���������
      * @Date: 2021/3/10
      */
-    public static void checkToken(String token) {
+    public static boolean checkToken(String token) {
         try {
             String[] tokenArray = TokenEncryptUtils.decoded(token).split("/");
             //������token������������
@@ -99,9 +99,9 @@
                         ResponseCodeEnum.TOKEN_INVALID.getMsg());
             }
         } catch (Exception e) {
-            throw new TokenException(ResponseCodeEnum.TOKEN_INVALID.getCode(),
-                    ResponseCodeEnum.TOKEN_INVALID.getMsg());
+            return false;
         }
+        return true;
     }
 
 
@@ -118,6 +118,11 @@
             throw new TokenException(ResponseCodeEnum.TOKEN_INVALID.getCode(),
                     ResponseCodeEnum.TOKEN_INVALID.getMsg());
         return userInfo;
+    }
+
+    public static Object getUserInfo() {
+        String token = getCurrentToken();
+        return getUserInfoByToken(token);
     }
 
     /**
@@ -146,6 +151,7 @@
         destoryToken(getUidByToken(token), token);
     }
 
+
     /**
      * @Description: ���������������������token
      * @Param: []

--
Gitblit v1.8.0