Commit 06c879978ca9be110e456960577cc2ac5dc734eb
1 parent
0e870168
fegin 微服务token问题
Showing
1 changed file
with
6 additions
and
1 deletions
jeecg-boot/jeecg-boot-base-api/jeecg-system-cloud-api/src/main/java/org/jeecg/config/FeignConfig.java
... | ... | @@ -36,7 +36,12 @@ public class FeignConfig { |
36 | 36 | HttpServletRequest request = attributes.getRequest(); |
37 | 37 | log.info("Feign request: {}", request.getRequestURI()); |
38 | 38 | // 将token信息放入header中 |
39 | - requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, request.getHeader(CommonConstant.X_ACCESS_TOKEN)); | |
39 | + String token = request.getHeader(CommonConstant.X_ACCESS_TOKEN); | |
40 | + if(token==null){ | |
41 | + token = request.getParameter("token"); | |
42 | + } | |
43 | + log.info("Feign request token: {}", token); | |
44 | + requestTemplate.header(CommonConstant.X_ACCESS_TOKEN, token); | |
40 | 45 | } |
41 | 46 | }; |
42 | 47 | } |
... | ... |