标签:insert open list 涂鸦 awl pre http lap state
1、这个问题是因为ueditor里面的Upload.class.php里面__construct()方法里面的iconv函数有问题
/*$this->stateMap[‘ERROR_TYPE_NOT_ALLOWED‘] = iconv(‘unicode‘, ‘utf-8‘, $this->stateMap[‘ERROR_TYPE_NOT_ALLOWED‘]);*/ $this->stateMap[‘ERROR_TYPE_NOT_ALLOWED‘] = mb_convert_encoding($this->stateMap[‘ERROR_TYPE_NOT_ALLOWED‘], ‘utf-8‘, ‘auto‘);
2、config.json 文件配置: imageUrlPrefix ,一般配置访问域名
1、ueditor.config.js
// var URL = window.UEDITOR_HOME_URL || getUEBasePath(); var URL =window.location.protocol+"//"+window.location.host; // 协议+域名,这里是80默认端口,如果是其他建议加上端口号 //为编辑器实例添加一个路径,这个不能被注释 UEDITOR_HOME_URL: ‘/ueditor/‘,// 静态文件路径 // 服务器统一请求接口路径 serverUrl: URL + "/plugin/EditorUpfile/requestUp",
2、config.json
*UrlPrefix=协议+域名+端口号 // 如果是80,可以不写 *PathFormat=> "/ueditor/upload/image/{yyyy}{mm}/{time}{rand:6}", /* 相对于域名上传保存路径,可以自定义保存路径和文件名格式 */
提示 errorHandler 未定义,在调用的前面添加
var errorHandler; errorHandler = function(title) { var loader = me.document.getElementById(loadingId); loader && domUtils.remove(loader); me.fireEvent(‘showmessage‘, { ‘id‘: loadingId, ‘content‘: title, ‘type‘: ‘error‘, ‘timeout‘: 5000 }); };
如果原型中定义了 showErrorLoader,可以直接调用 showErrorLoader。
可以测试一下 php 代码是否正确执行,在浏览器打开 ueditor/controller.php 对应的路径,看看是有配置值返回(json 格式)
{"imageActionName":"uploadimage","imageFieldName":"upfile","imageMaxSize":10485760,"imageAllowFiles":[".jpeg",".jpg",".png",".gif"],"imageCompressEnable":true,"imageCompressBorder":1600,"imageInsertAlign":"none","imageUrlPrefix":"http:\/\/tp.com\/","imagePathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","scrawlActionName":"uploadscrawl","scrawlFieldName":"upfile","scrawlPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","scrawlMaxSize":2048000,"scrawlUrlPrefix":"","scrawlInsertAlign":"none","snapscreenActionName":"uploadimage","snapscreenPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","snapscreenUrlPrefix":"","snapscreenInsertAlign":"none","catcherLocalDomain":["127.0.0.1","localhost","img.baidu.com"],"catcherActionName":"catchimage","catcherFieldName":"source","catcherPathFormat":"\/ueditor\/upload\/image\/{yyyy}{mm}\/{time}{rand:6}","catcherUrlPrefix":"","catcherMaxSize":2048000,"catcherAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"videoActionName":"uploadvideo","videoFieldName":"upfile","videoPathFormat":"\/ueditor\/upload\/video\/{yyyy}{mm}\/{time}{rand:6}","videoUrlPrefix":"","videoMaxSize":104857600,"videoAllowFiles":[".avi",".mov",".wav",".mp4",".mp3"],"fileActionName":"uploadfile","fileFieldName":"upfile","filePathFormat":"\/ueditor\/upload\/file\/{yyyy}{mm}\/{time}{rand:6}","fileUrlPrefix":"http:\/\/tp.com","fileMaxSize":52428800,"fileAllowFiles":[".txt",".doc",". docx",". xls",". xlsx",". ppt",".htm",".html",".zip",".rar",".gz",".bz2",".pdf"],"imageManagerActionName":"listimage","imageManagerListPath":"\/ueditor\/upload\/image\/","imageManagerListSize":20,"imageManagerUrlPrefix":"","imageManagerInsertAlign":"none","imageManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp"],"fileManagerActionName":"listfile","fileManagerListPath":"\/ueditor\/upload\/file\/","fileManagerUrlPrefix":"","fileManagerListSize":20,"fileManagerAllowFiles":[".png",".jpg",".jpeg",".gif",".bmp",".flv",".swf",".mkv",".avi",".rm",".rmvb",".mpeg",".mpg",".ogg",".ogv",".mov",".wmv",".mp4",".webm",".mp3",".wav",".mid",".rar",".zip",".tar",".gz",".7z",".bz2",".cab",".iso",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".pdf",".txt",".md",".xml"]}
需要在config.json 中添加
"scrawlAllowFiles":[".png", ".jpg", ".jpeg", ".gif", ".bmp"]/* 图片格式 */
标签:insert open list 涂鸦 awl pre http lap state
原文地址:https://www.cnblogs.com/xuey/p/13182375.html