| | |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | HandlerMethod handlerMethod = (HandlerMethod) handler; |
| | | Class<?> beanType = handlerMethod.getBeanType(); |
| | | if (!beanType.isAnnotationPresent(LoginNoRequired.class) || !handlerMethod.hasMethodAnnotation(LoginNoRequired.class)) { |
| | | if (!beanType.isAnnotationPresent(LoginNoRequired.class) && !handlerMethod.hasMethodAnnotation(LoginNoRequired.class)) { |
| | | //获取token |
| | | String token = request.getHeader(Constants.HEADER_USER_TOKEN); // 从 http 请求头中取出 token |
| | | if (StringUtils.isNotBlank(token)) { |