Blumonilr 6 年之前
父節點
當前提交
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
     @Override
     public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
     public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object object) throws Exception {
+        if(!(object instanceof HandlerMethod)){
+            return true;
+        }
         HandlerMethod handlerMethod=(HandlerMethod)object;
         HandlerMethod handlerMethod=(HandlerMethod)object;
         Method method=handlerMethod.getMethod();
         Method method=handlerMethod.getMethod();
         if (method.isAnnotationPresent(RootAllowed.class)) {
         if (method.isAnnotationPresent(RootAllowed.class)) {