From 0eb24d42a0f9a2498639bc9bfcf1dd1ca5f5ba59 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 10 Nov 2020 10:19:38 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E8=8E=B7=E5=8F=96accesstok?= =?UTF-8?q?en=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/WxmpMessageServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java index ca8aa468dc..d8e6a43485 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageServiceImpl.java @@ -365,7 +365,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { StringBuilder govKey = new StringBuilder(customerId).append(":").append(WxmpMessageConstant.GOV_REDIS); authorizerRefreshToken = new HashMap<>(); try { - authorizerRefreshToken = wxmpMessageRedis.getAuthorizerRefreshToken(resiKey.toString()); + authorizerRefreshToken = wxmpMessageRedis.getAuthorizerRefreshToken(govKey.toString()); } catch (Exception e) { errorMsg = e.getMessage(); } From fa7143f95591a89d2737d35b2618b06b94d85281 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 11 Nov 2020 14:56:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9Agateway=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=86=85=E9=83=A8=E6=8E=A5=E5=8F=A3url=E7=99=BD?= =?UTF-8?q?=E5=90=8D=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/auth/InternalAuthProcessor.java | 6 ++++++ .../src/main/java/com/epmet/filter/CpProperty.java | 5 +++++ epmet-gateway/src/main/resources/bootstrap.yml | 4 ++++ 3 files changed, 15 insertions(+) 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/**