优化权限解析逻辑

This commit is contained in:
zhouhao
2017-08-29 22:31:11 +08:00
parent 4c3975f200
commit 617af7026d

View File

@@ -16,6 +16,7 @@ import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
/**
@@ -48,10 +49,13 @@ public class DefaultAopMethodAuthorizeDefinitionParser implements AopMethodAutho
if (!CollectionUtils.isEmpty(parserCustomers)) {
definition = parserCustomers.stream()
.map(customer -> customer.parse(paramContext))
.filter(Objects::nonNull)
.findAny().orElse(null);
if (definition != null) {
if(definition instanceof EmptyAuthorizeDefinition)return null;
return definition;
}
}
Authorize classAuth = AopUtils.findAnnotation(paramContext.getTarget().getClass(), Authorize.class);