package com.zztrapp.zztrapp.utilcode.mUtil;

import com.bumptech.glide.load.model.GlideUrl;
import com.bumptech.glide.load.model.LazyHeaders;
import com.zztrapp.zztrapp.http.HttpApi;
import com.zztrapp.zztrapp.utilcode.util.SPUtils;

/**
 * Describe
 * Created by Bby on 2021/10/17
 * Email bby0856@163.com
 */
public class GlideMyUtil {
    //Glie加header
    public static GlideUrl getGlideUrl(String path) {

        String okhttpCookies = SPUtils.getInstance().getString("okhttpCookies", "");
        String p = "?filePath=";
        String authorization = SPUtils.getInstance().getString("authorization", "");
        GlideUrl glideUrl = new GlideUrl(HttpApi.BASE_URL + HttpApi.DOWNLOAD_FTP + p + path, new LazyHeaders.Builder()
                .addHeader("X-Access-Token", authorization)
                .addHeader("Cookie", okhttpCookies)
                .build());
        return glideUrl;
    }

}
