public static Method getMethod(JoinPoint joinPoint) { Method method = null; String name = joinPoint.getSignature().getName(); try { // 这才是 正统! MethodSignature signature = (MethodSignature) joinPoint.getSignature(); Class[] types = signature.getParameterTypes(); joinPoint.getSignature(); method = joinPoint.getTarget(). getClass().getMethod(name,types); } catch (NoSuchMethodException e) { e.printStackTrace(); } return method; }
多个连接点--
@Before("@annotation(cloud.cjy.travel.module.common.annotation.CjyAspect) || within(@cloud.cjy.travel.module.common.annotation.CjyAspect *)")