简单的上传适配器
介绍:现成的简单的上传适配器,简单,只需要提供uploadUrl。
不足:不能定制,如:另外携带参数,返回处理等
配置
import { SimpleUploadAdapter } from '@ckeditor/ckeditor5-upload';
// config中
plugins: [ SimpleUploadAdapter, /* ... */ ],
toolbar: [ /* ... */ ],
simpleUpload: {
// The URL that the images are uploaded to.
uploadUrl: 'http://example.com',
// Enable the XMLHttpRequest.withCredentials property.
withCredentials: true,
// Headers sent along with the XMLHttpRequest to the upload server.
headers: {
'X-CSRF-TOKEN': 'CSRF-Token',
Authorization: 'Bearer <JSON Web Token>'
}
}