I use the custom upload adapter of custom ckeditor5, which can upload normally, but I don"t use the official adapter to clear the files that failed to upload, and I use my own adapter. After failure, the edit box cannot be edited
class MyUploadAdapter {
constructor(loader) {
this.loader = loader;
}
upload() {
return new Promise((resolve, reject) => {
// let size = this.loader.file.size;
// if (size / 1024 > 2048) {
// reject("2M");
// }
const data = new FormData();
const config = {
headers: {"content-type": "multipart/form-data"}
};
data.append("imageFile", this.loader.file);
axios.post("xxxx", data, config).then(res => {
if (res) {
if (res.data.code == 200) {
resolve({
default: res.data.data
});
} else {
reject(res.data.msg);
}
} else {
reject();
}
}).catch(error => {
console.log("33333");
console.log(error);
reject(error)
});
}).catch(error => {
console.log(error);
});
}
abort() {
}
}