From 64643fa1d8db499d67c07b0e2c03b94d7ee31da6 Mon Sep 17 00:00:00 2001 From: fengshuonan Date: Fri, 14 Jul 2023 16:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=908.0=E3=80=91=E3=80=90auth=E3=80=91?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E4=BB=8Ecookie=E4=B8=AD=E8=8E=B7=E5=8F=96tok?= =?UTF-8?q?en=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/api/loginuser/CommonLoginUserUtil.java | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/loginuser/CommonLoginUserUtil.java b/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/loginuser/CommonLoginUserUtil.java index 805571e79..0eb5ffe2c 100644 --- a/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/loginuser/CommonLoginUserUtil.java +++ b/kernel-d-auth/auth-api/src/main/java/cn/stylefeng/roses/kernel/auth/api/loginuser/CommonLoginUserUtil.java @@ -6,7 +6,6 @@ import cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum; import cn.stylefeng.roses.kernel.auth.api.expander.AuthConfigExpander; import cn.stylefeng.roses.kernel.rule.util.HttpServletUtil; -import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; /** @@ -42,20 +41,6 @@ public class CommonLoginUserUtil { return authToken; } - // 3. 从cookie中获取token - String sessionCookieName = AuthConfigExpander.getSessionCookieName(); - Cookie[] cookies = request.getCookies(); - if (cookies != null && cookies.length > 0) { - for (Cookie cookie : cookies) { - - // 如果cookie有对应的值,并且不为空 - if (sessionCookieName.equals(cookie.getName()) - && StrUtil.isNotBlank(cookie.getValue())) { - return cookie.getValue(); - } - } - } - // 获取不到token,直接告诉用户 throw new AuthException(AuthExceptionEnum.TOKEN_GET_ERROR); }