A-A+
解决Thinkphp加入Ueditor后不能上传图片
在ThinkPHP中加入百度编辑器Ueditor不能上传图片,如下图:
解决方法看代码:
<script type="text/javascript"> window.UEDITOR_HOME_URL='__ROOT__/Data/Ueditor/'; window.onload=function(){ window.UEDITOR_CONFIG.initialFrameHeight=400; window.UEDITOR_CONFIG.initialFrameWidth=800; window.UEDITOR_CONFIG.savePath = ['Uploads']; //多添加这么一行代码即可 window.UEDITOR_CONFIG.imageUrl="{:U(GROUP_NAME.'/Blog/upload')}"; window.UEDITOR_CONFIG.imagePath='__ROOT__/Uploads/'; UE.getEditor('content'); } </script> <js file="__ROOT__/Data/Ueditor/ueditor.config.js" /> <js file="__ROOT__/Data/Ueditor/ueditor.all.min.js" />