权限过滤
程序员文章站
2022-07-12 18:54:44
...
权限过滤的根本是通过url里面是否包含权限关键字,并且根据需求进行对应的处理。
// TODO Auto-generated method stub
// place your code here
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
User user = new User(1,"zhao",123456,1);
String requestURI = req.getRequestURI();
if(user.getUserType()==1){
if(!requestURI.contains("user")){
System.out.println("权限不够");
return;
}
chain.doFilter(request, response);
}
上一篇: 路由器和过滤器:Zuul(章节10)
下一篇: 敏感词过滤