拦截器的霸哥Security的UsernamePasswordAuthenticationToken请各位看下

springSecurity拦截器Debug

   UsernamePasswordAuthenticationToken authenticationToken=null;
        try{
           authenticationToken=getAuthentication(request);//或取请求中的Token信息
            if (authenticationToken != null) {//Token令牌为null
                SecurityContextHolder.getContext().setAuthentication(authenticationToken);
            } else {
                ResponseUtil.out(response, Result.failed("鉴权失败"));
            }
            String url=request.getRequestURI();
            boolean check=MetadataSource.Matcher(url);//该Matcher连接数据库匹配权限
            if(check){
                chain.doFilter(request,response);
            }else{
                ResponseUtil.out(response,Result.failed("该用户没有此权限"));
            }
        }catch (Exception e){
            ResponseUtil.out(response, Result.failed(e.getMessage()));
        }

运行到 boolean check=MetadataSource.Matcher(url); 就跳到catch(Exception e){ResponseUtil.out(response,Result.failed(e.getMessage()));}
可是e,getMessage() 是null 这是为什么?

catch语句里面添加e.printStack,看一下

谁知道你抛异常怎么搞的

打个断点看一下是什么类型的异常不就知道了