use of io.leopard.security.admin.annotion.Role in project leopard by tanhaichao.
the class RoleInterceptor method preHandle.
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
// logger.info("preHandle uri:" + request.getRequestURI() + " handler:" + handler.getClass());
if (!(handler instanceof HandlerMethod)) {
return true;
}
// TODO ahai 这里要加上缓存?
HandlerMethod method = (HandlerMethod) handler;
Role role = method.getMethodAnnotation(Role.class);
if (role == null) {
return true;
}
this.check(role, request);
return true;
}
Aggregations