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-加密信息");
}
}

  

posted @ 2022-09-27 18:06  未确定  阅读(253)  评论(0编辑  收藏  举报