Commit 89b16f81 authored by hezhen's avatar hezhen

123

parent 25bb1b7b
......@@ -2,6 +2,7 @@ package com.github.wxiaoqi.security.api.vo.config;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
......@@ -17,6 +18,7 @@ import java.util.Enumeration;
* @description 设置请求头部信息,防止微服务之间调用请求头部信息丢失
* @data 2019/6/25 16:22
*/
@Slf4j
public class HeaderConfig implements RequestInterceptor {
@Override
......@@ -31,6 +33,7 @@ public class HeaderConfig implements RequestInterceptor {
while (headerNames.hasMoreElements()){
String headerName = headerNames.nextElement();
String headerValue = request.getHeader(headerName);
log.info("----headerName===="+headerName+"----headerValue===="+headerValue);
template.header(headerName,headerValue);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment