From 6450fec60b8dc7e6d31779bcfe3b23b3f665ebaf Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Tue, 28 Dec 2021 15:08:45 +0800 Subject: [PATCH] screen-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