Skip to content

Commit bec1763

Browse files
authored
fix #1024
1 parent 86d76cf commit bec1763

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

static/js/blog.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ $(function () {
5353
shade: [0.1, '#fff'] // 0.1 透明度的白色背景
5454
});
5555
} else if ($state === "success") {
56-
// if ($res.errcode === 0) {
57-
// var value = '![](' + $res.url + ')';
58-
if ($res[0].errcode === 0) {
59-
var value = '![](' + $res[0].url + ')';
56+
var $data = $res instanceof Array ? $res[0] : $res;
57+
if ($data.errcode === 0) {
58+
var value = '![](' + $data.url + ')';
6059
window.editor.insertValue(value);
6160
}
6261
}
@@ -168,4 +167,4 @@ $(function () {
168167
}
169168
$("#documentTemplateModal").modal('hide');
170169
});
171-
});
170+
});

0 commit comments

Comments
 (0)