Browse Source

无拦截器时不通过 Invocation 调用目标方法

James 2 years ago
parent
commit
940a2366bb
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/main/java/com/jfinal/ext/proxy/CglibCallback.java

+ 4 - 2
src/main/java/com/jfinal/ext/proxy/CglibCallback.java

@@ -52,13 +52,15 @@ class CglibCallback implements MethodInterceptor {
 			InterceptorCache.put(key, inters);
 		}
 		
+		if (inters.length == 0) {
+		    return methodProxy.invokeSuper(target, args);
+		}
+		
 		Invocation invocation = new Invocation(target, method, inters,
 			x -> {
 				return methodProxy.invokeSuper(target, x);
 			}
 		, args);
-		
-		
 		invocation.invoke();
 		return invocation.getReturnValue();
 	}