From a9fccbb40f0b48d73725d816d03f221cb1c1104c Mon Sep 17 00:00:00 2001 From: thinkgem Date: Mon, 29 Nov 2021 12:44:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E5=8E=BB=E6=8E=89simpleuploa?= =?UTF-8?q?d=E5=9B=A0=E4=B8=BAie=E4=B8=8B=E6=9C=89=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../third-party/webuploader/webuploader.js | 2 +- .../static/ueditor/1.4/ueditor.all.js | 20 +++++++++++++------ .../static/ueditor/1.4/ueditor.config.js | 2 +- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/core/src/main/resources/static/ueditor/1.4/third-party/webuploader/webuploader.js b/modules/core/src/main/resources/static/ueditor/1.4/third-party/webuploader/webuploader.js index 8526e4fd..42f8afc4 100644 --- a/modules/core/src/main/resources/static/ueditor/1.4/third-party/webuploader/webuploader.js +++ b/modules/core/src/main/resources/static/ueditor/1.4/third-party/webuploader/webuploader.js @@ -2971,7 +2971,7 @@ method: 'POST', // 跨域时,是否允许携带cookie, 只有html5 runtime才有效 - withCredentials: false, + withCredentials: true, fileVal: 'file', timeout: 2 * 60 * 1000, // 2分钟 formData: {}, diff --git a/modules/core/src/main/resources/static/ueditor/1.4/ueditor.all.js b/modules/core/src/main/resources/static/ueditor/1.4/ueditor.all.js index d317abe7..f00da6b3 100644 --- a/modules/core/src/main/resources/static/ueditor/1.4/ueditor.all.js +++ b/modules/core/src/main/resources/static/ueditor/1.4/ueditor.all.js @@ -24467,7 +24467,7 @@ UE.plugin.register('simpleupload', function (){ var w = containerBtn.offsetWidth || 20, h = containerBtn.offsetHeight || 20, btnIframe = document.createElement('iframe'), - btnIframe2 = document.createElement('iframe'), // ThinkGem + btnIframe2 = document.createElement('div'), // ThinkGem btnStyle = 'display:block;width:' + w + 'px;height:' + h + 'px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;'; domUtils.on(btnIframe, 'load', function(){ @@ -24487,10 +24487,6 @@ UE.plugin.register('simpleupload', function (){ 'style="' + btnStyle + '">' + '';// + //''; - - // 解决因 iframe 嵌套问题 session 丢失 ThinkGem - btnIframe2.id = 'edui_iframe_' + timestrap; - btnIframe2.name = 'edui_iframe_' + timestrap; wrapper.className = 'edui-' + me.options.theme; wrapper.id = me.ui.id + '_iframeupload'; @@ -24506,7 +24502,19 @@ UE.plugin.register('simpleupload', function (){ var form = btnIframeDoc.getElementById('edui_form_' + timestrap); var input = btnIframeDoc.getElementById('edui_input_' + timestrap); - var iframe = btnIframe2;//btnIframeDoc.getElementById('edui_iframe_' + timestrap); + var iframe;// = btnIframeDoc.getElementById('edui_iframe_' + timestrap); + + // 解决因 iframe 嵌套问题 session 丢失 ThinkGem + try{ + iframe = document.createElement(''); + }catch(e){ + iframe = document.createElement('iframe'); + iframe.id = 'edui_iframe_' + timestrap; + iframe.name = 'edui_iframe_' + timestrap; + } +// btnIframeBody.appendChild(iframe); + btnIframe2.appendChild(iframe); domUtils.on(input, 'change', function(){ if(!input.value) return; diff --git a/modules/core/src/main/resources/static/ueditor/1.4/ueditor.config.js b/modules/core/src/main/resources/static/ueditor/1.4/ueditor.config.js index 22fc7130..5899317a 100644 --- a/modules/core/src/main/resources/static/ueditor/1.4/ueditor.config.js +++ b/modules/core/src/main/resources/static/ueditor/1.4/ueditor.config.js @@ -42,7 +42,7 @@ 'paragraph', 'fontfamily', 'fontsize', 'customstyle', 'insertcode', '|', 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|', 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|', - 'simpleupload', 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map',/* 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', */'template', 'background', '|', + 'insertimage', 'emotion', 'scrawl', 'insertvideo', 'music', 'attachment', 'map',/* 'gmap', 'insertframe', 'insertcode', 'webapp', 'pagebreak', */'template', 'background', '|', 'horizontal', 'date', 'time', 'spechars', /*'snapscreen', */'wordimage', '|', 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|', 'print', 'preview', 'searchreplace', 'drafts', 'help'