Springboot AOP操作
2019-04-19 本文已影响0人
风雪幻城
https://www.mekau.com/4880.html

@Aspect
public class MyAspect{
//定义切点
@Pointcut("within(com.*.MyAnnotation)")
public void myPointcut(){
}
@Around("myPointcut()")//多个切点可以使用 & | 连接
public Object doAuthentication(ProceedingJoinPoint pjp) throws Throwable {
//TODO
//pjp中有传入参数
//校验通过,继续执行目标方法
return pjp.proceed();
}
}