UEditor使用笔记

2018-12-28  本文已影响12人  你的代码写得很烂
uploadUrl = "服务器地址";
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action) {
    if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
        return uploadUrl;
    } else if (action == 'uploadvideo') {
        return uploadUrl;
    } else {
        return this._bkGetActionUrl.call(this, action);
    }
}
ue.execCommand('serverparam', function(editor) {
    return {
        'type': 'image'
    };
});

/ueditor/dialogs/image/image.js

uploader.on('uploadBeforeSend', function (file, data, header) {
    //这里可以通过data对象添加POST参数
    header['X_Requested_With'] = 'XMLHttpRequest';
    data['type'] = 'image';//POST添加type参数
});

1.上传图片时POST传参暂时没找到;
2.上传图片返回json格式自定义处理未找到解决办法。

上一篇下一篇

猜你喜欢

热点阅读