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

解决编辑器上传的问题

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