diff --git a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java index 98583c8f3c..2ee22426f6 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -131,6 +131,12 @@ public class InternalAuthProcessor extends AuthProcessor { * @return */ private boolean needAuth(String requestUri) { + for (String url : cpProperty.getInternalAuthUrlsWhiteList()) { + if (antPathMatcher.match(url, requestUri)) { + return false; + } + } + for (String url : cpProperty.getInternalAuthUrls()) { if (antPathMatcher.match(url, requestUri)) { return true; diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java index 4b801182fa..3442dea612 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpProperty.java @@ -22,6 +22,11 @@ public class CpProperty { */ private List internalAuthUrls; + /** + * 内部认证url白名单 + */ + private List internalAuthUrlsWhiteList; + /** * 对外部应用开放的url列表 */ diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index ad698b4d8a..53ec286911 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -439,6 +439,10 @@ epmet: - /resi/home/** - /data/report/** + # 内部认证url白名单(在白名单中的,就不会再校验登录了) + internalAuthUrlsWhiteList: + - /epmetuser/customerstaff/customerlist + # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: - /data/report/**