67,515
社区成员
发帖
与我相关
我的任务
分享
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
//如果不是映射到方法直接通过
if (!(handler instanceof HandlerMethod)) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
//如果验证token失败
if (method.getAnnotation(Action.class) == null) {
return true;
}
//从request中得到你想要的参数
业务代码
return true;
}