Blumonilr 6 лет назад
Родитель
Сommit
67a1da2840
1 измененных файлов с 3 добавлено и 0 удалено
  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)) {