@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD})
@Documented
public @interface CheckLogin {
}
@Slf4j
@Aspect
@Component
public class CheckLoginInterceptor {
@Resource
private LoginService loginService;
@Pointcut("@annotation(CheckLogin)")
public void annotationPointCut() {
}
@Around("annotationPointCut()")
public Object doBeforeValidate(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
loginService.checkLogin();
}