【update】pdf.js 请求增加token
This commit is contained in:
@@ -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
|
||||
//# sourceMappingURL=pdf.js.map
|
||||
|
||||
Reference in New Issue
Block a user