From 55ebea88af1463d017afe03fdc137dcf7ab3dce8 Mon Sep 17 00:00:00 2001 From: zhangdaiscott Date: Tue, 14 Sep 2021 17:08:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E6=81=AF=E9=98=9F=E5=88=97=E4=B8=AD?= =?UTF-8?q?=E6=8A=A5=E5=BE=AE=E6=9C=8D=E5=8A=A1=E5=BC=82=E5=B8=B8=20issues?= =?UTF-8?q?/I4977W?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/jeecg/config/FeignConfig.java | 5 +++++ .../src/main/java/org/jeecg/config/FeignConfig.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-api/jeecg-system-cloud-api/src/main/java/org/jeecg/config/FeignConfig.java b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-api/jeecg-system-cloud-api/src/main/java/org/jeecg/config/FeignConfig.java index 49e50031..658ae3db 100644 --- a/jeecg-boot/jeecg-boot-base/jeecg-boot-base-api/jeecg-system-cloud-api/src/main/java/org/jeecg/config/FeignConfig.java +++ b/jeecg-boot/jeecg-boot-base/jeecg-boot-base-api/jeecg-system-cloud-api/src/main/java/org/jeecg/config/FeignConfig.java @@ -11,6 +11,7 @@ import javax.servlet.http.HttpServletRequest; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.PathMatcherUtil; +import org.jeecg.common.config.mqtoken.UserTokenContext; import org.jeecg.config.sign.interceptor.SignAuthConfiguration; import org.jeecg.config.sign.util.HttpUtils; import org.jeecg.config.sign.util.SignUtil; @@ -88,6 +89,10 @@ public class FeignConfig { e.printStackTrace(); } } + }else{ + String token = UserTokenContext.getToken(); + log.debug("Feign request token: {}", token); + requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token); } }; } diff --git a/jeecg-boot/jeecg-boot-starter/jeecg-boot-starter-cloud/src/main/java/org/jeecg/config/FeignConfig.java b/jeecg-boot/jeecg-boot-starter/jeecg-boot-starter-cloud/src/main/java/org/jeecg/config/FeignConfig.java index 3a51a210..5681066a 100644 --- a/jeecg-boot/jeecg-boot-starter/jeecg-boot-starter-cloud/src/main/java/org/jeecg/config/FeignConfig.java +++ b/jeecg-boot/jeecg-boot-starter/jeecg-boot-starter-cloud/src/main/java/org/jeecg/config/FeignConfig.java @@ -8,6 +8,7 @@ import java.util.SortedMap; import javax.servlet.http.HttpServletRequest; +import org.jeecg.common.config.mqtoken.UserTokenContext; import org.jeecg.common.constant.CommonConstant; import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.PathMatcherUtil; @@ -88,6 +89,10 @@ public class FeignConfig { e.printStackTrace(); } } + }else{ + String token = UserTokenContext.getToken(); + log.debug("Feign request token: {}", token); + requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token); } }; }