package com.zcloud.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;

public class ApiRequestInterceptor implements RequestInterceptor {

    private String key;
    public ApiRequestInterceptor(String x,String slat) {
        this.key = "3dc7b7d6957f22c1ac1ed0724ca8d432";
    }

    @Override
    public void apply(RequestTemplate template) {
        template.header("token", key);
        template.removeHeader("Content-Type");
        // 需要先移除 Content-Type 不然变成‘text/plain;charset=UTF-8,application/json’ 只需要application/json即可
        template.header("Content-Type", "application/json");
    }
}
