debug: 2.0.2版本编辑器API修改

This commit is contained in:
磷叶 2025-04-08 18:47:17 +08:00
parent 41d5eb5297
commit e131da3db0

View File

@ -45,11 +45,11 @@ class ImageHandler {
// //
const range = this.quill.getSelection(true); const range = this.quill.getSelection(true);
if (!range) return; if (!range) return;
// Quill // Quill
const currentHtml = this.quill.root.innerHTML; const currentHtml = this.quill.root.innerHTML;
this.quill.root.innerHTML = currentHtml; this.quill.root.innerHTML = currentHtml;
const file = items[i].getAsFile(); const file = items[i].getAsFile();
this.upload(file, range, this); this.upload(file, range, this);
break; break;
@ -63,7 +63,7 @@ class ImageHandler {
} }
const formData = new FormData(); const formData = new FormData();
formData.append('file', file); formData.append('file', file);
axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, { axios.post(process.env.VUE_APP_BASE_API + "/common/upload", formData, {
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
@ -176,7 +176,7 @@ export default {
if (val !== this.currentValue) { if (val !== this.currentValue) {
this.currentValue = val === null ? "" : val; this.currentValue = val === null ? "" : val;
if (this.Quill) { if (this.Quill) {
this.Quill.pasteHTML(this.currentValue); this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue);
} }
} }
}, },