From 41a33a80254a5163693bdea4c7da5b258f972b03 Mon Sep 17 00:00:00 2001 From: fengchenchen Date: Tue, 16 Jul 2024 18:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90update=E3=80=91pdf.js=20=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=A2=9E=E5=8A=A0token?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/pdfjs/build/pdf.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/public/pdfjs/build/pdf.js b/public/pdfjs/build/pdf.js index 212325e0..a791fa38 100644 --- a/public/pdfjs/build/pdf.js +++ b/public/pdfjs/build/pdf.js @@ -938,7 +938,12 @@ function getDocument(src) { const task = new PDFDocumentLoadingTask(); const url = src.url ? getUrlProp(src.url) : null; const data = src.data ? getDataProp(src.data) : null; - const httpHeaders = src.httpHeaders || null; + const token = localStorage.getItem('pro__Access-Token') + let tokenValue = token ? JSON.parse(token).value : '' + const header = { + 'X-Access-Token': tokenValue + } + const httpHeaders = Object.assign(src.httpHeaders || {}, header); const withCredentials = src.withCredentials === true; const password = src.password ?? null; const rangeTransport = src.range instanceof PDFDataRangeTransport ? src.range : null; @@ -15493,7 +15498,7 @@ exports.SVGGraphics = SVGGraphics; /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; -/******/ +/******/ /******/ // The require function /******/ function __w_pdfjs_require__(moduleId) { /******/ // Check if module is in cache @@ -15507,14 +15512,14 @@ exports.SVGGraphics = SVGGraphics; /******/ // no module.loaded needed /******/ exports: {} /******/ }; -/******/ +/******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __w_pdfjs_require__); -/******/ +/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } -/******/ +/******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. @@ -15789,4 +15794,4 @@ const pdfjsBuild = 'af6414988'; /******/ })() ; }); -//# sourceMappingURL=pdf.js.map \ No newline at end of file +//# sourceMappingURL=pdf.js.map