在pdfjs的getDocument()请求中添加自定义标头

代码如下:

var parameter = {
    url: PREVIEW_URL+"?id=" +docId,
    httpHeaders: { "X-Access-Token":localStorage.getItem('X-Access-Token')},
    withCredentials: true,
} 
var loadingTask = pdfjsLib.getDocument(parameters);

猜你喜欢

转载自blog.csdn.net/qq_30776829/article/details/130233358
今日推荐