提交 ad283b5f 编写于 作者: Skyeye云's avatar Skyeye云

解决编辑器上传的问题

上级 d89ac33c
......@@ -30,6 +30,12 @@ layui.config({
colorpicker = layui.colorpicker,
device = layui.device();
var currentUserId = "";
// 获取当前登录员工信息
systemCommonUtil.getSysCurrentLoginUserMation(function (data){
currentUserId = data.bean.id;
});
//遮罩层显示
$(".fileconsole-mask").show();
matchingLanguage();
......@@ -1427,7 +1433,7 @@ layui.config({
//文件权限控制
function authControllerFile(createId){
//如果当前登陆人是文件创建人,可以删除,回收站,重命名,剪切,否则不能
if(getCookie('userToken') === createId){
if(currentUserId === createId){
$(".fileReName").show();//重命名显示
$(".deleteFolderAndChild").show();//删除显示
$(".cutUrl").show();//剪切显示
......
......@@ -12,9 +12,9 @@ var ueEditorUtil = {
UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
UE.Editor.prototype.getActionUrl = function(action){
if (action == 'uploadimage' || action == 'uploadfile' || action == 'uploadvideo' || action == 'uploadimage'){//上传单个图片,上传附件,上传视频,多图上传
return reqBasePath + '/upload/editUploadController/uploadContentPic?userToken=' + getCookie('userToken');
return reqBasePath + '/upload/editUploadController/uploadContentPic';
} else if(action == 'listimage'){
return reqBasePath + '/upload/editUploadController/downloadContentPic?userToken=' + getCookie('userToken');
return reqBasePath + '/upload/editUploadController/downloadContentPic';
}else{
return this._bkGetActionUrl.call(this, action);
}
......
......@@ -704,6 +704,7 @@
uploader.on('uploadBeforeSend', function (file, data, header) {
//这里可以通过data对象添加POST参数
header['X_Requested_With'] = 'XMLHttpRequest';
$.extend(header, getRequestHeaders());
});
uploader.on('uploadProgress', function (file, percentage) {
......
......@@ -8240,6 +8240,7 @@ UE.ajax = function() {
}
}
};
xhr.setRequestHeader('userToken', getCookie('userToken'));
if (method == "POST") {
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(submitStr);
......@@ -23841,6 +23842,7 @@ UE.plugin.register('autoupload', function (){
fd.append('type', 'ajax');
xhr.open("post", url, true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader('userToken', getCookie('userToken'));
xhr.addEventListener('load', function (e) {
try{
var json = (new Function("return " + utils.trim(e.target.response)))();
......@@ -24626,6 +24628,7 @@ UE.plugin.register('simpleupload', function (){
type: 'POST',
cache: false,
data: formData,
headers: getRequestHeaders(),
processData: false,
contentType: false,
success: function (data) {
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册