diff --git a/application/service/UeditorService.php b/application/service/UeditorService.php index fa7a5902a..9a31d1925 100644 --- a/application/service/UeditorService.php +++ b/application/service/UeditorService.php @@ -171,6 +171,10 @@ class UeditorService $data = $up->getFileInfo(); if(isset($data['state']) && $data['state'] == 'SUCCESS') { + if($attachment_type == 'scrawl') + { + $attachment_type = 'image'; + } $data['type'] = $attachment_type; $data['path_type'] = self::$path_type; return ResourcesService::AttachmentAdd($data); @@ -292,7 +296,7 @@ class UeditorService $data = $up->getFileInfo(); if(isset($data['state']) && $data['state'] == 'SUCCESS') { - $data['type'] = 'remote'; + $data['type'] = 'image'; $data['path_type'] = self::$path_type; $ret = ResourcesService::AttachmentAdd($data); if($ret['code'] == 0) diff --git a/public/static/common/lib/ueditor/ueditor.all.js b/public/static/common/lib/ueditor/ueditor.all.js index 3dc7fe659..4f3075e8b 100755 --- a/public/static/common/lib/ueditor/ueditor.all.js +++ b/public/static/common/lib/ueditor/ueditor.all.js @@ -23243,31 +23243,31 @@ UE.plugins['catchremoteimage'] = function () { //成功抓取 success: function (r) { try { - var info = r.code == 0 ? r:eval("(" + r.responseText + ")"); + var info = ((r.status || 0) == 200 && (r.responseText || null) != null) ? eval("(" + r.responseText + ")") : null; + if(info == null || info.code != 0) + { + return; + } } catch (e) { return; } /* 获取源路径和新路径 */ - var i, j, ci, cj, oldSrc, newSrc, list = info.data || null; - if(list == null || list.length <= 0) + var i, newSrc, list = info.data || null; + if(list == null || list.length <= 0 || list.length != imgs.length) { return; } // 循环处理图片替换 - for (i = 0; ci = imgs[i++];) { - oldSrc = ci.getAttribute("_src") || ci.src || ""; - for (j = 0; cj = list[j++];) { - if((cj.url || null) != null) - { - newSrc = catcherUrlPrefix + cj.url; - domUtils.setAttributes(ci, { - "src": newSrc, - "_src": newSrc - }); - } - break; + for (i = 0; i