| | |
| | |
|
| | | import java.util.Map;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import com.ruoyi.common.core.utils.ip.IpUtils;
|
| | | import org.springframework.stereotype.Component;
|
| | | import com.ruoyi.common.core.constant.CacheConstants;
|
| | | import com.ruoyi.common.core.utils.ServletUtils;
|
| | |
| | | {
|
| | | requestTemplate.header(CacheConstants.DETAILS_USERNAME, userName);
|
| | | }
|
| | | String authentication = headers.get(CacheConstants.AUTHORIZATION_HEADER);
|
| | | if (StringUtils.isNotEmpty(authentication))
|
| | | {
|
| | | requestTemplate.header(CacheConstants.AUTHORIZATION_HEADER, authentication);
|
| | | }
|
| | |
|
| | | // 配置客户端IP
|
| | | requestTemplate.header("X-Forwarded-For", IpUtils.getIpAddr(ServletUtils.getRequest()));
|
| | | }
|
| | | }
|
| | | } |