feat:【framework 框架】@PermitAll、@TenantIgnore 支持接口级
This commit is contained in:
parent
f0402f69e1
commit
efb2092261
@ -137,7 +137,8 @@ public class YudaoTenantAutoConfiguration {
|
|||||||
// 获得有 @TenantIgnore 注解的接口
|
// 获得有 @TenantIgnore 注解的接口
|
||||||
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethodMap.entrySet()) {
|
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethodMap.entrySet()) {
|
||||||
HandlerMethod handlerMethod = entry.getValue();
|
HandlerMethod handlerMethod = entry.getValue();
|
||||||
if (!handlerMethod.hasMethodAnnotation(TenantIgnore.class)) {
|
if (!handlerMethod.hasMethodAnnotation(TenantIgnore.class) // 方法级
|
||||||
|
&& !handlerMethod.getBeanType().isAnnotationPresent(TenantIgnore.class)) { // 接口级
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 添加到忽略的 URL 中
|
// 添加到忽略的 URL 中
|
||||||
|
|||||||
@ -165,7 +165,8 @@ public class YudaoWebSecurityConfigurerAdapter {
|
|||||||
// 获得有 @PermitAll 注解的接口
|
// 获得有 @PermitAll 注解的接口
|
||||||
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethodMap.entrySet()) {
|
for (Map.Entry<RequestMappingInfo, HandlerMethod> entry : handlerMethodMap.entrySet()) {
|
||||||
HandlerMethod handlerMethod = entry.getValue();
|
HandlerMethod handlerMethod = entry.getValue();
|
||||||
if (!handlerMethod.hasMethodAnnotation(PermitAll.class)) {
|
if (!handlerMethod.hasMethodAnnotation(PermitAll.class) // 方法级
|
||||||
|
&& !handlerMethod.getBeanType().isAnnotationPresent(PermitAll.class)) { // 接口级
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Set<String> urls = new HashSet<>();
|
Set<String> urls = new HashSet<>();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user