{
plugins:
"advlist anchor autosave code codesample directionality emoticons fullscreen image axupimgs importcss " +
" insertdatetime link autolink lists media nonbreaking pagebreak preview save searchreplace" +
" table visualblocks visualchars wordcount charmap help",
// 文件上传接口
images_upload_handler: function (blobInfo, callback) {
return new Promise((resolve)=> {
var xhr;
let formData = new FormData();
var aliyunOssOptions = {
key:
"cloud/img/" +
Math.floor(Math.random() * 10000) +
"_" +
/(.+)\.(.+)$/.exec(blobInfo.filename?blobInfo.filename(): blobInfo.file.name)[0],
Policy: ossData.policy,
OSSAccessKeyId: ossData.accessid,
success_action_status: "200",
signature: ossData.signature,
};
for (var attr in aliyunOssOptions) {
formData.append(attr, aliyunOssOptions[attr]);
}
formData.append("file", blobInfo.blob());
xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.open("POST", ossData.host);
xhr.onload = function () {
callback(ossData.host + "/" + aliyunOssOptions.key, {width: "100%"});
resolve(ossData.host + "/" + aliyunOssOptions.key, {width: "100%"})
};
xhr.send(formData);
})
}
}
tinymce axupimgs
于 2024-03-01 09:29:44 首次发布