FeignClient调用服务,添加header的参数信息
添加 配置文件
@Configuration
public class FeignClientInterceptor implements RequestInterceptor {
public static final String AUTHORIZATION = "Authorization";
public static final String appid = "app-id";
public static final String BEARER = "Bearer";
@Override
public void apply(RequestTemplate requestTemplate) {
requestTemplate.header(appid, "123");
requestTemplate.header(AUTHORIZATION, "token-加密信息");
}
}