RequireAuth.java 499 B

1234567891011121314151617
  1. package com.nylc.touyan.auth;
  2. import java.lang.annotation.Documented;
  3. import java.lang.annotation.ElementType;
  4. import java.lang.annotation.Retention;
  5. import java.lang.annotation.RetentionPolicy;
  6. import java.lang.annotation.Target;
  7. /**
  8. * 标注在 Controller 方法上,要求请求必须携带有效登录态。
  9. * 由 {@link AuthInterceptor} 统一校验,未登录返回 401。
  10. */
  11. @Target(ElementType.METHOD)
  12. @Retention(RetentionPolicy.RUNTIME)
  13. @Documented
  14. public @interface RequireAuth {
  15. }