允许TokenIgnore标记在类上面
This commit is contained in:
@@ -5,7 +5,7 @@ import java.lang.annotation.*;
|
|||||||
/**
|
/**
|
||||||
* @author hao
|
* @author hao
|
||||||
*/
|
*/
|
||||||
@Target(ElementType.METHOD)
|
@Target({ElementType.METHOD,ElementType.TYPE})
|
||||||
@Documented
|
@Documented
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface TokenIgnore {
|
public @interface TokenIgnore {
|
||||||
|
|||||||
@@ -46,6 +46,12 @@ public class TsTokenAspect {
|
|||||||
@Before("methodArgs()")
|
@Before("methodArgs()")
|
||||||
public void before(JoinPoint joinPoint) {
|
public void before(JoinPoint joinPoint) {
|
||||||
|
|
||||||
|
Object aThis = joinPoint.getTarget();
|
||||||
|
TokenIgnore annotation = aThis.getClass().getAnnotation(TokenIgnore.class);
|
||||||
|
if (annotation != null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 过滤不要需要验证的接口
|
// 过滤不要需要验证的接口
|
||||||
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
|
||||||
Method method = signature.getMethod();
|
Method method = signature.getMethod();
|
||||||
|
|||||||
Reference in New Issue
Block a user