From a72902f1d4a1719a1ae43aaaf1121689ed04911a Mon Sep 17 00:00:00 2001 From: xioayue Date: Sat, 2 Jul 2022 16:26:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chjyj/szwh/Interceptor/ChInterceptor.java | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/src/main/java/cn/chjyj/szwh/Interceptor/ChInterceptor.java b/src/main/java/cn/chjyj/szwh/Interceptor/ChInterceptor.java index c726aea..0d0aacb 100644 --- a/src/main/java/cn/chjyj/szwh/Interceptor/ChInterceptor.java +++ b/src/main/java/cn/chjyj/szwh/Interceptor/ChInterceptor.java @@ -2,14 +2,9 @@ package cn.chjyj.szwh.Interceptor; import cn.chjyj.szwh.annotation.PassToken; -import cn.chjyj.szwh.bean.Admin; import cn.chjyj.szwh.exception.ChException; -import cn.chjyj.szwh.service.AdminService; -import cn.chjyj.szwh.service.impl.AdminServiceImpl; -import cn.chjyj.szwh.utils.JwtUtils; import com.auth0.jwt.JWT; import com.auth0.jwt.interfaces.DecodedJWT; -import jdk.internal.instrumentation.Logger; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -57,22 +52,6 @@ public class ChInterceptor implements HandlerInterceptor { //2 验证是否 String payload=decode.getPayload(); request.setAttribute("pstr",payload); -// String userId = decode.getClaim("userid").asString(); -// //获取载荷内容 -// String userName = JwtUtils.getClaimByName(token, "userName").asString(); -// String realName = JwtUtils.getClaimByName(token, "realName").asString(); - - //找找看是否有这个user 因为我们需要检查用户是否存在,读者可以自行修改逻辑 -// AdminService adminService = new AdminServiceImpl(); -// Admin admin = adminService.getAdminByAccountId(userId); -// -// if (admin == null) { -// throw new ChException("用户不存在"); -// }else{ -// //放入attribute以便后面调用 -// request.setAttribute("uid", admin.getId()); -// request.setAttribute("acount_name",admin.getAccountName()); //登录账号 -// } return true; } return true;