diff --git a/chat_web_front/src/views/reading/index.vue b/chat_web_front/src/views/reading/index.vue index 540543c..bdd6371 100644 --- a/chat_web_front/src/views/reading/index.vue +++ b/chat_web_front/src/views/reading/index.vue @@ -217,6 +217,7 @@ import Loading from "@/components/Loading.vue"; import {UploadFilled} from '@element-plus/icons-vue'; import {ElMessage, ElMessageBox, type UploadFile, type UploadFiles} from "element-plus"; import Mark from "mark.js"; +import axios from '@/utils/request/axios'; // ===================== 面板尺寸与折叠 ===================== const leftWidth = ref(280); @@ -437,10 +438,11 @@ const loadPdfFile = async () => { if (!selectedFile.value) return; docHtml.value = ''; try { - const resp = await downloadFile({ fileId: selectedFile.value.fileId }); - const blob = new Blob([resp]); - const arrayBuffer = await blob.arrayBuffer(); - pdfData.value = arrayBuffer; + const resp = await axios.get('/gpt/file/downloadFile', { + params: { fileId: selectedFile.value.fileId }, + responseType: 'arraybuffer' + }); + pdfData.value = resp.data; } catch (e: any) { pdfData.value = null; docHtml.value = '

PDF 文件加载失败

';