百度编辑器图片在线流量返回url改动
百度编辑器中返回的是我们server中的url,有时并非我们须要的,比方图文编辑中。我想在线浏览上传过的图片 ,那么我返回的应该是腾讯server上面的url。这样才不会被腾讯的过滤器过来掉,全部我们就须要改动在线管理的图片获取路径详细操作例如以下:
BaseState fileState = null;
File file = null;
String realpath= null;
for ( Object obj : files ) {
if ( obj == null ) {
break;
}
file = (File)obj;
fileState = new BaseState( true );
realpath= PathFormat.format( this.getPath( file ) );
//fileState.putInfo( "url", PathFormat.format( this.getPath( file ) ) );
//TODO 处理列出的图片信息
String url=UploadToTX.urlSelect(realpath);
fileState.putInfo( "url", url);
state.addState( fileState );
}
return state;
改动后的在线浏览还是浏览不出来,还须要改动对话框中的js文件。改动/ueditor/dialogs/image/image.js以下的js就能够了。不然会显示图片引用未授权。
//TODO
//img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
img.setAttribute('src', urlPrefix + list[i].url );
最新文章
- sql2008备份集中的数据库备份与现有的xxx数据库不同解决方法
- Windows7+VS2012下OpenGL 4的环境配置
- C# 多线程操作样例
- leetcode:Rectangle Area
- 转载-KMP算法前缀数组优雅实现
- 使用for xml path 分组查询
- 光盘卡在MacBook里退不出来咋办?
- 转:SRIO错误侦测和管理机制
- 使用MBROSTool 工具制作U盘多启动盘的方法总结
- string转QBytearray
- swagger.core的使用方法
- PHP手动搭建环境
- 服务器RAID设置以及简单理解
- php mysqli 的使用方法
- C# 值类型
- Arduino入门笔记(3):单LED闪烁
- 开发JAVA9以上的项目时,出现ClassNotFoundException: javax.xml.bind.JAXBException的解决方法
- JDBC选择数据库实例
- 获取设备和 App 信息
- 2018.07.06 POJ1273 Drainage Ditches(最大流)