mirror of
https://gitee.com/dromara/sa-token.git
synced 2026-02-27 16:50:24 +08:00
新增 SaCheckOr 注解,批量注解鉴权:只要满足其中一个注解即可通过验证
This commit is contained in:
@@ -45,7 +45,7 @@ public class SaTokenDaoOfRedisJson implements SaTokenDao {
|
||||
redisBucket = redisClient.getBucket();
|
||||
|
||||
// 重写 SaSession 生成策略
|
||||
SaStrategy.me.createSession = (sessionId) -> new SaSessionForJson(sessionId);
|
||||
SaStrategy.instance.createSession = (sessionId) -> new SaSessionForJson(sessionId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -181,12 +181,12 @@ public class SaTokenFilter implements SaFilter, Filter { //之所以改名,为
|
||||
Method method = action.method().getMethod();
|
||||
|
||||
// 如果此 Method 或其所属 Class 标注了 @SaIgnore,则忽略掉鉴权
|
||||
if (SaStrategy.me.isAnnotationPresent.apply(method, SaIgnore.class)) {
|
||||
if (SaStrategy.instance.isAnnotationPresent.apply(method, SaIgnore.class)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 注解校验
|
||||
SaStrategy.me.checkMethodAnnotation.accept(method);
|
||||
SaStrategy.instance.checkMethodAnnotation.accept(method);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -230,12 +230,12 @@ public class SaTokenInterceptor implements RouterInterceptor {
|
||||
Method method = action.method().getMethod();
|
||||
|
||||
// 如果此 Method 或其所属 Class 标注了 @SaIgnore,则忽略掉鉴权
|
||||
if (SaStrategy.me.isAnnotationPresent.apply(method, SaIgnore.class)) {
|
||||
if (SaStrategy.instance.isAnnotationPresent.apply(method, SaIgnore.class)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 注解校验
|
||||
SaStrategy.me.checkMethodAnnotation.accept(method);
|
||||
SaStrategy.instance.checkMethodAnnotation.accept(method);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user