百度ue编辑器关闭自动抓取远程图片

来源:互联网 发布:shell python传值 编辑:程序博客网 时间:2024/04/30 07:21

本人新手,各位大神有好的意见欢迎留言评论,我将感激不尽

开发过程中发现百度的ueditor编辑器会自动远程抓取图片,那么怎么让编辑器不会自动远程抓取图片呢,网上大概的了解了一下

于是马上查阅:ueditor.all.js文件,发现如下代码

// plugins/catchremoteimage.js///import core///commands 远程图片抓取///commandsName  catchRemoteImage,catchremoteimageenable///commandsTitle  远程图片抓取/** * 远程图片抓取,当开启本插件时所有不符合本地域名的图片都将被抓取成为本地服务器上的图片 */UE.plugins['catchremoteimage'] = function () {    var me = this,        ajax = UE.ajax;    /* 设置默认值 */    if (me.options.catchRemoteImageEnable === falsereturn;    me.setOpt({        catchRemoteImageEnable: false    });    //.......};

发现了吧,有个配置参数:catchRemoteImageEnable

立马加在:ueditor.config.js 加上配置参数

一定要再空白处添加

//抓取远程图片是否开启,默认true

,catchRemoteImageEnable:false

然后编辑器页面,刷新,然后复制粘贴远程图片,这时不再向服务端发送get请求catchimage。

0 0