From 94563a89f024fa6f7cccd021e7bca42f3e0fc931 Mon Sep 17 00:00:00 2001 From: zlt Date: Mon, 12 Aug 2019 23:53:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96Feign=E6=8B=A6=E6=88=AA?= =?UTF-8?q?=E5=99=A8=EF=BC=8C=E5=A2=9E=E5=8A=A0userid=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/ribbon/config/FeignInterceptorConfig.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zlt-commons/zlt-ribbon-spring-boot-starter/src/main/java/com/central/common/ribbon/config/FeignInterceptorConfig.java b/zlt-commons/zlt-ribbon-spring-boot-starter/src/main/java/com/central/common/ribbon/config/FeignInterceptorConfig.java index da49e1e8..cc8f3503 100644 --- a/zlt-commons/zlt-ribbon-spring-boot-starter/src/main/java/com/central/common/ribbon/config/FeignInterceptorConfig.java +++ b/zlt-commons/zlt-ribbon-spring-boot-starter/src/main/java/com/central/common/ribbon/config/FeignInterceptorConfig.java @@ -40,6 +40,12 @@ public RequestInterceptor requestInterceptor() { } */ + //传递userid + String userid = request.getHeader(SecurityConstants.USER_ID_HEADER); + if (StrUtil.isNotEmpty(userid)) { + template.header(SecurityConstants.USER_ID_HEADER, userid); + } + //传递username String username = request.getHeader(SecurityConstants.USER_HEADER); if (StrUtil.isNotEmpty(username)) {