[前端] 修复PDF加载:正确处理downloadFile返回的blob格式
This commit is contained in:
@@ -437,8 +437,9 @@ const loadPdfFile = async () => {
|
||||
if (!selectedFile.value) return;
|
||||
docHtml.value = '';
|
||||
try {
|
||||
const blob = await downloadFile({ fileId: selectedFile.value.fileId });
|
||||
const arrayBuffer = await (blob as Blob).arrayBuffer();
|
||||
const resp = await downloadFile({ fileId: selectedFile.value.fileId });
|
||||
const blob = new Blob([resp]);
|
||||
const arrayBuffer = await blob.arrayBuffer();
|
||||
pdfData.value = arrayBuffer;
|
||||
} catch (e: any) {
|
||||
pdfData.value = null;
|
||||
|
||||
Reference in New Issue
Block a user