From 379426bad0da4be47d1967ce344697891b6492da Mon Sep 17 00:00:00 2001 From: yangjie <1179743470@qq.com> Date: Fri, 4 Jun 2021 13:32:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=89=80=E6=9C=89=E5=AD=98=E5=9C=A8us?= =?UTF-8?q?erId=E7=9A=84=E8=AF=B7=E6=B1=82=E8=BF=9B=E8=A1=8C=E9=89=B4?= =?UTF-8?q?=E6=9D=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yipin/liuwanr/filter/AuthInterceptor.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/yipin/liuwanr/filter/AuthInterceptor.java b/src/main/java/com/yipin/liuwanr/filter/AuthInterceptor.java index 5f53dca..8e68ef3 100644 --- a/src/main/java/com/yipin/liuwanr/filter/AuthInterceptor.java +++ b/src/main/java/com/yipin/liuwanr/filter/AuthInterceptor.java @@ -38,15 +38,16 @@ public class AuthInterceptor implements HandlerInterceptor { Object loginStatus = ops.get(token); //userid String userId = request.getParameter("userId"); - if (!StringUtils.isEmpty(userId)){ - return userId.equals(ops.get(token)); - } - if( Objects.isNull(loginStatus)){ response.getWriter().print("1");//token错误 return false; + }else { + if (!StringUtils.isEmpty(userId)){ + return userId.equals(loginStatus); + }else { + return false; + } } - return true; } @Override