From 12dad0a063a88f43128c014341d91fea08ef2f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=86=B7=E5=86=B7?= Date: Thu, 14 Feb 2019 19:48:32 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20Fixing=20a=20bug.=20jar=20=E5=8C=85?= =?UTF-8?q?=E4=B8=AD=E7=9A=84AOP=20=E6=B2=A1=E6=9C=89=E6=8B=A6=E6=88=AA@In?= =?UTF-8?q?ner=20=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...urityInnerAspect.java => PigSecurityInnerAspect.java} | 9 +++++++-- .../src/main/resources/META-INF/spring.factories | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) rename pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/{PigxSecurityInnerAspect.java => PigSecurityInnerAspect.java} (90%) diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigxSecurityInnerAspect.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigSecurityInnerAspect.java similarity index 90% rename from pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigxSecurityInnerAspect.java rename to pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigSecurityInnerAspect.java index 0acc2783..813adf80 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigxSecurityInnerAspect.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/component/PigSecurityInnerAspect.java @@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.Ordered; import org.springframework.security.access.AccessDeniedException; import org.springframework.stereotype.Component; @@ -32,7 +33,7 @@ import javax.servlet.http.HttpServletRequest; /** * @author lengleng - * @date 2018/11/26 + * @date 2019/02/14 *

* 服务间接口不鉴权处理逻辑 */ @@ -40,7 +41,7 @@ import javax.servlet.http.HttpServletRequest; @Aspect @Component @AllArgsConstructor -public class PigxSecurityInnerAspect { +public class PigSecurityInnerAspect implements Ordered { private final HttpServletRequest request; @SneakyThrows @@ -54,4 +55,8 @@ public class PigxSecurityInnerAspect { return point.proceed(); } + @Override + public int getOrder() { + return Ordered.HIGHEST_PRECEDENCE + 1; + } } diff --git a/pig-common/pig-common-security/src/main/resources/META-INF/spring.factories b/pig-common/pig-common-security/src/main/resources/META-INF/spring.factories index 8b0ebb6e..a162c5ad 100755 --- a/pig-common/pig-common-security/src/main/resources/META-INF/spring.factories +++ b/pig-common/pig-common-security/src/main/resources/META-INF/spring.factories @@ -1,6 +1,7 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.pig4cloud.pig.common.security.component.PermissionService,\ com.pig4cloud.pig.common.security.component.PigAccessDeniedHandler,\ + com.pig4cloud.pig.common.security.component.PigSecurityInnerAspect,\ com.pig4cloud.pig.common.security.component.ResourceAuthExceptionEntryPoint,\ com.pig4cloud.pig.common.security.component.PigResourceServerTokenRelayAutoConfiguration,\ com.pig4cloud.pig.common.security.feign.PigFeignClientConfiguration,\