From d3fd2c3c208b0433d11483abe7e085789a4e0d82 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 25 Feb 2021 14:12:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=86=85=E9=83=A8=E9=89=B4?= =?UTF-8?q?=E6=9D=83=E5=A4=84=E7=90=86=E5=99=A8=EF=BC=8C=E8=A7=A3=E5=86=B3?= =?UTF-8?q?header=E4=B8=ADCustomerId=E9=87=8D=E5=A4=8D=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/auth/InternalAuthProcessor.java | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) 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 bd7d740297..15406173b2 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -111,17 +111,24 @@ public class InternalAuthProcessor extends AuthProcessor { builder.header(AppClientConstant.APP,baseTokenDto.getApp()); builder.header(AppClientConstant.CLIENT,baseTokenDto.getClient()); builder.header(AppClientConstant.USER_ID,baseTokenDto.getUserId()); - if (StringUtils.isNotBlank(baseTokenDto.getCustomerId())) { - builder.header(AppClientConstant.CUSTOMER_ID,baseTokenDto.getCustomerId()); - } - if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI)) {//工作端/居民端 - if(StringUtils.isNotBlank(customerId)){ - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + if(StringUtils.isNotBlank(customerId)){ + if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI, "public")) {//工作端/居民端 + builder.header(AppClientConstant.CUSTOMER_ID, customerId); } - } else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); } + + //if (StringUtils.isNotBlank(baseTokenDto.getCustomerId())) { + // builder.header(AppClientConstant.CUSTOMER_ID,baseTokenDto.getCustomerId()); + //} + // + //if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI)) {//工作端/居民端 + // if(StringUtils.isNotBlank(customerId)){ + // exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + // } + //} else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 + // exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + //} ServerHttpRequest build = exchange.getRequest().mutate().build(); return exchange.mutate().request(build).build(); }