package com.dskj.trustlend.api;


import com.dskj.trustlend.InitApp;
import com.dskj.trustlend.utils.LogUtils;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * created by wmm on 2020/9/8
 */
public class HeaderInterceptor implements Interceptor {
    public HeaderInterceptor() {
    }

    @Override
    public Response intercept(Chain chain) throws IOException {
        Request request = chain.request().newBuilder()
                .addHeader("Access-Token", InitApp.getToken())
                .addHeader("User-Token", InitApp.getUserToken())
                .build();
        LogUtils.i("头文件："+InitApp.getToken());
        return chain.proceed(request);
    }
}