我使用的是 tinymce 6.1.0,添加了添加图像的功能,但resolve切断了部分https://localhost:5001并仅返回文件的相对路径,但我需要一个绝对路径。如何解决这个问题?
var editor = tinymce.init(
{
selector: '#UpdateViewModel_HtmlContent',
setup: function (editor)
{
editor.on('change', function ()
{
editor.save();
});
},
images_upload_handler: function (blobInfo, progress)
{
return new Promise((resolve, reject) =>
{
formData = new FormData();
formData.append(blobInfo.filename(), blobInfo.blob());
abp.ajax({
type: "POST",
url: abp.appPath + 'api/static/editing/content/image',
data: formData,
processData: false,
contentType: false,
success: function (res)
{
progress && progress(100);
resolve('https://localhost:5001/' + res.url);
},
error: function (err)
{
reject('Failed to upload image to server');
},
formData: "multipart/form-data"
});
});
},
plugins: 'image code',
toolbar: 'undo redo | link image | code',
file_picker_types: 'image'
});
init我在方法中添加了以下选项:这些将无助于获取文件的绝对路径