百度编辑器
2020-05-15 15:13 平凡故事 阅读(263) 评论(0) 编辑 收藏 举报一、ueditor.config.js里面的URL,var URL = '/ueditor/'
二、ueditor.config.js里面的serverUrl,对应的UeditorServerController里面的路径地址,拿config.json
三、如果是requireJS加载,ZeroClipboard.js替换代码
_globalConfig.activeClass = "zeroclipboard-is-active";
if (typeof define === "function" && define.amd) {
define(function() {
return ZeroClipboard;
});
} else if (typeof module === "object" && module && typeof module.exports === "object" && module.exports) {
module.exports = ZeroClipboard;
}
window.ZeroClipboard = ZeroClipboard;
四、ueditor.all.js 代码行数24520前后端联调,改成后端返回的数据
//前后端数据联调
if(json.code === '0' && json.data){
loader = me.document.getElementById(loadingId);
loader.setAttribute('src', json.data);
loader.setAttribute('_src', json.data);
loader.setAttribute('title', json.title || '');
loader.setAttribute('alt', json.original || '');
loader.removeAttribute('id');
domUtils.removeClasses(loader, 'loadingclass');
}else{
showErrorLoader && showErrorLoader(json.success);
}
五、自定义上传路径,图片上传接口需要后端开发提供
//设置富文本编辑器
_setTinymce: function(){
if($('#editor').length == 0){
return
}
UE.getEditor('editor');
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) {
if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
return '/uploadToFileSystem';//此处写自定义的图片上传路径
} else {
return this._bkGetActionUrl.call(this, action);
}
}
},
参考链接http://www.mamicode.com/info-detail-2603156.html
https://www.jianshu.com/p/8b7250e94f70
https://blog.csdn.net/patire/article/details/78550636