update images upload (#944)

* update images upload

* modify js res.url
This commit is contained in:
hotqin888
2024-06-03 10:58:07 +08:00
committed by GitHub
parent 397dced5ce
commit db620be8df
5 changed files with 331 additions and 279 deletions

View File

@@ -53,8 +53,10 @@ $(function () {
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
});
} else if ($state === "success") {
if ($res.errcode === 0) {
var value = '![](' + $res.url + ')';
// if ($res.errcode === 0) {
// var value = '![](' + $res.url + ')';
if ($res[0].errcode === 0) {
var value = '![](' + $res[0].url + ')';
window.editor.insertValue(value);
}
}

View File

@@ -251,8 +251,11 @@ $(function () {
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
});
} else if ($state === "success") {
if ($res.errcode === 0) {
var value = '![](' + $res.url + ')';
// if ($res.errcode === 0) {
// var value = '![](' + $res.url + ')';
// 3xxx 20240602
if ($res[0].errcode === 0) {
var value = '![](' + $res[0].url + ')';
window.editor.insertValue(value);
}
}

View File

@@ -77,10 +77,11 @@ $(function () {
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
});
} else if ($state === "success") {
if ($res.errcode === 0) {
// if ($res.errcode === 0) {
if ($res[0].errcode === 0) {
var range = window.editor.getSelection();
window.editor.insertEmbed(range.index, 'image', $res.url);
// window.editor.insertEmbed(range.index, 'image', $res.url);
window.editor.insertEmbed(range.index, 'image', $res[0].url);
}
}
});