fix cast exception

yixian 5 years ago
parent 50ba01ce48
commit f590a95bb8

@ -42,8 +42,12 @@ public class ManagerUserInterceptor extends HandlerInterceptorAdapter implements
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (handler instanceof HandlerMethod) {
Method method = ((HandlerMethod) handler).getMethod(); Method method = ((HandlerMethod) handler).getMethod();
return handleMethod(method, request, response) && super.preHandle(request, response, handler); return handleMethod(method, request, response) && super.preHandle(request, response, handler);
} else {
return super.preHandle(request, response, handler);
}
} }
private boolean handleMethod(Method method, HttpServletRequest request, HttpServletResponse response) { private boolean handleMethod(Method method, HttpServletRequest request, HttpServletResponse response) {

Loading…
Cancel
Save