From 8bcbf5701022a0df3b4c4d110f29de86296d6212 Mon Sep 17 00:00:00 2001 From: huqi Date: Fri, 2 Jul 2021 04:43:29 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtoken=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E6=B6=89=E5=8F=8A=E5=88=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 5879fee0c934503a04309489b6d135769e999e9b) --- o2web/source/o2_core/o2.js | 3 ++- o2web/source/o2_core/o2/actionWorker.js | 5 +++-- o2web/source/o2_core/o2/widget/JavascriptEditor.js | 4 +++- o2web/source/o2_core/scriptWorker.js | 1 + .../x_component_process_ProcessDesigner/$Process/route.html | 4 ++-- o2web/source/x_desktop/index.html | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/o2web/source/o2_core/o2.js b/o2web/source/o2_core/o2.js index 52c6351ed9..4fda5e2b53 100644 --- a/o2web/source/o2_core/o2.js +++ b/o2web/source/o2_core/o2.js @@ -1555,7 +1555,8 @@ if (window.Promise && !Promise.any){ address: o2.filterUrl(address), body: data, debug: (window.layout && layout["debugger"]), - token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "" + token: (window.layout && layout.session && layout.session.user) ? layout.session.user.token : "", + tokenName: o2.tokenName } var actionWorker = new Worker("../o2_core/o2/actionWorker.js"); var p = new Promise(function(s,f){ diff --git a/o2web/source/o2_core/o2/actionWorker.js b/o2web/source/o2_core/o2/actionWorker.js index 52b0bbbaeb..1477928fc8 100644 --- a/o2web/source/o2_core/o2/actionWorker.js +++ b/o2web/source/o2_core/o2/actionWorker.js @@ -34,6 +34,7 @@ function V(httpRequest) { var body = data.body; var debug = data.debug; var token = data.token; + var tokenName = data.tokenName; if (noCache) url = url+(((url.indexOf("?")!==-1) ? "&" : "?")+(new Date()).getTime()); @@ -44,8 +45,8 @@ function V(httpRequest) { this.request.setRequestHeader("Accept", "text/html,application/json,*/*"); if (debug) this.request.setRequestHeader("x-debugger", "true"); if (token){ - this.request.setRequestHeader(o2.tokenName, token); - this.request.setRequestHeader("authorization", token); + this.request.setRequestHeader(tokenName, token); + this.request.setRequestHeader("Authorization", token); } this.request.send(body); diff --git a/o2web/source/o2_core/o2/widget/JavascriptEditor.js b/o2web/source/o2_core/o2/widget/JavascriptEditor.js index e7a58be101..c3311ed654 100644 --- a/o2web/source/o2_core/o2/widget/JavascriptEditor.js +++ b/o2web/source/o2_core/o2/widget/JavascriptEditor.js @@ -21,6 +21,7 @@ o2.widget.JavascriptEditor = new Class({ this.unbindEvents = []; this.node = $(node); this.id = o2.uuid(); + if (!o2.JSEditorCWE.isInit) o2.JSEditorCWE.init(); }, getDefaultEditorData: function(){ switch (this.options.type) { @@ -850,6 +851,7 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { this.scriptWorker.onmessage = function(e) { if (e.data && e.data.type=="ready") this.setOnMessage(); }.bind(this); + this.isInit = true; return this; }, setOnMessage: function(){ @@ -872,4 +874,4 @@ o2.widget.JavascriptEditor.completionWorkerEnvironment = o2.JSEditorCWE = { this.scriptWorker.postMessage(o); } } -}.init(); +}; diff --git a/o2web/source/o2_core/scriptWorker.js b/o2web/source/o2_core/scriptWorker.js index 366408979f..45e1790d02 100644 --- a/o2web/source/o2_core/scriptWorker.js +++ b/o2web/source/o2_core/scriptWorker.js @@ -157,6 +157,7 @@ o2.addReady(function () { o2.getJSON("../x_desktop/res/config/config.json", function (config) { layout.config = config; + o2.tokenName = config.tokenName || "x-token"; configLoaded = true; if (configLoaded && commonLoaded && lpLoaded) _getDistribute(function () { _load(); }); }); diff --git a/o2web/source/x_component_process_ProcessDesigner/$Process/route.html b/o2web/source/x_component_process_ProcessDesigner/$Process/route.html index 1e52cdb1c3..d7dbb1f652 100644 --- a/o2web/source/x_component_process_ProcessDesigner/$Process/route.html +++ b/o2web/source/x_component_process_ProcessDesigner/$Process/route.html @@ -36,8 +36,8 @@ {{$.lp.opinionRequired}}: - 是 - 否 + {{$.lp.yes}} + {{$.lp.no}} diff --git a/o2web/source/x_desktop/index.html b/o2web/source/x_desktop/index.html index 51596a30a0..59ea69932a 100644 --- a/o2web/source/x_desktop/index.html +++ b/o2web/source/x_desktop/index.html @@ -6,7 +6,7 @@ - O2 + O2OA -- GitLab