当前位置: 移动技术网 > IT编程>开发语言>JavaScript > CKEditor 4 上传图片

CKEditor 4 上传图片

2019年05月22日  | 移动技术网IT编程  | 我要评论

参考资料:basic configuration

直接ctrl+v(粘贴图片)报错信息:上传文件时发生网络错误(networkerror:network error occurred during file upload)

版本:4.11.4

ckeditor.editorconfig = function( config ) {
    // define changes to default configuration here. for example:
    // config.language = 'fr';
    // config.uicolor = '#aadc6e';
    config.toolbargroups = [
        { name: 'clipboard', groups: ['clipboard', 'undo'] },
        { name: 'editing', groups: ['find', 'selection', 'spellchecker', 'editing'] },
        { name: 'forms', groups: ['forms'] },
        { name: 'basicstyles', groups: ['basicstyles', 'cleanup'] },
        { name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi', 'paragraph'] },
        { name: 'links', groups: ['links'] },
        { name: 'insert', groups: ['insert'] },
        { name: 'styles', groups: ['styles'] },
        { name: 'colors', groups: ['colors'] },
        { name: 'document', groups: ['document', 'doctools', 'mode'] },
        { name: 'tools', groups: ['tools'] },
        { name: 'others', groups: ['others'] },
        { name: 'about', groups: ['about'] }
    ];

  //移除的按钮 config.removebuttons = 'templates,print,find,replace,selectall,scayt,checkbox,form,radio,textfield,textarea,select,button,imagebutton,hiddenfield,creatediv,blockquote,bidiltr,bidirtl,flash,pagebreak,iframe,about,showblocks,smiley,specialchar,horizontalrule,copyformatting,removeformat'; //上传图片窗口用到的接口 config.filebrowserimageuploadurl = "https://192.168.0.1/api/ecategorydetail/uploadimg"; config.filebrowseruploadurl = "https://192.168.0.1/api/ecategorydetail/uploadimg"; // 使上传图片弹窗出现对应的“上传”tab标签 config.removedialogtabs = 'image:advanced;link:advanced'; //粘贴图片时用得到 config.extraplugins = 'uploadimage'; config.uploadurl = 'https://192.168.0.1/api/ecategorydetail/uploadimg'; };

 留下的按钮样式如下图:

建议大家有条件的直接用谷歌,百度找了半天没有有用的资料。

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网