From e131da3db0834fd10b86f2ed980ff941949c5ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Tue, 8 Apr 2025 18:47:17 +0800 Subject: [PATCH] =?UTF-8?q?debug:=202.0.2=E7=89=88=E6=9C=AC=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E5=99=A8API=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Editor/index.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 519b417..4e2b47a 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -45,11 +45,11 @@ class ImageHandler { // 保存当前光标位置 const range = this.quill.getSelection(true); if (!range) return; - + // 阻止Quill默认的粘贴处理 const currentHtml = this.quill.root.innerHTML; this.quill.root.innerHTML = currentHtml; - + const file = items[i].getAsFile(); this.upload(file, range, this); break; @@ -63,7 +63,7 @@ class ImageHandler { } const formData = new FormData(); formData.append('file', file); - + axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, { headers: { Authorization: "Bearer " + getToken(), @@ -176,7 +176,7 @@ export default { if (val !== this.currentValue) { this.currentValue = val === null ? "" : val; if (this.Quill) { - this.Quill.pasteHTML(this.currentValue); + this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue); } } },