Blumonilr 6 years ago
parent
commit
67a1da2840
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/main/java/com/nju/edu/pay/web/AuthenticationInterceptor.java

+ 3 - 0
src/main/java/com/nju/edu/pay/web/AuthenticationInterceptor.java

@@ -19,6 +19,9 @@ public class AuthenticationInterceptor implements HandlerInterceptor {
 
     @Override
     public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
+        if(!(object instanceof HandlerMethod)){
+            return true;
+        }
         HandlerMethod handlerMethod=(HandlerMethod)object;
         Method method=handlerMethod.getMethod();
         if (method.isAnnotationPresent(RootAllowed.class)) {