From f0a304d6d7ca55a890869c60b08d69e679188f38 Mon Sep 17 00:00:00 2001 From: gssong <1742057357@qq.com> Date: Sun, 4 Jun 2023 14:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=94=BB=E5=9B=BE=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3token=EF=BC=8C=E4=BC=98=E5=8C=96=E7=94=BB=E5=9B=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/toolbar-default-actions.js | 5 +++++ .../editor-app/configuration/url-config.js | 12 ++++++------ .../static/flowable-modeler/scripts/app-cfg.js | 8 ++++---- .../scripts/configuration/url-config.js | 10 +++++----- src/views/workflow/model/design.vue | 18 +++++++++++++++--- 5 files changed, 35 insertions(+), 18 deletions(-) diff --git a/public/static/flowable-modeler/editor-app/configuration/toolbar-default-actions.js b/public/static/flowable-modeler/editor-app/configuration/toolbar-default-actions.js index ab60e3a..a50419e 100644 --- a/public/static/flowable-modeler/editor-app/configuration/toolbar-default-actions.js +++ b/public/static/flowable-modeler/editor-app/configuration/toolbar-default-actions.js @@ -411,6 +411,11 @@ angular.module('flowableModeler').controller('SaveModelCtrl', [ '$rootScope', '$ url: FLOWABLE.URL.putModel(modelMetaData.modelId)}) .success(function (data, status, headers, config) { + if(data.code === 500){ + alert(data.msg) + $scope.status.loading = false; + return false + } editorManager.handleEvents({ type: ORYX.CONFIG.EVENT_SAVED }); diff --git a/public/static/flowable-modeler/editor-app/configuration/url-config.js b/public/static/flowable-modeler/editor-app/configuration/url-config.js index 4f897cc..67cf208 100644 --- a/public/static/flowable-modeler/editor-app/configuration/url-config.js +++ b/public/static/flowable-modeler/editor-app/configuration/url-config.js @@ -15,27 +15,27 @@ var FLOWABLE = FLOWABLE || {}; FLOWABLE.URL = { getModel: function(modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json?version=' + Date.now(); + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; }, getStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/editor?version=' + Date.now(); + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/editor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; }, getCmmnStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/cmmneditor?version=' + Date.now(); + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/cmmneditor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; }, getDmnStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/dmneditor?version=' + Date.now(); + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/dmneditor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; }, putModel: function(modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json'; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json'+'?Authorization=Bearer '+window.parent.this.token; }, validateModel: function(){ - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate'; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate'+'?Authorization=Bearer '+window.parent.this.token; } }; \ No newline at end of file diff --git a/public/static/flowable-modeler/scripts/app-cfg.js b/public/static/flowable-modeler/scripts/app-cfg.js index ae693d2..7dd32ef 100644 --- a/public/static/flowable-modeler/scripts/app-cfg.js +++ b/public/static/flowable-modeler/scripts/app-cfg.js @@ -16,13 +16,13 @@ 'use strict'; var FLOWABLE = FLOWABLE || {}; - var pathname = window.location.pathname.replace(/^(\/[^\/]*)(\/.*)?modeler\/?$/, '$1').replace(/\/$/, ''); +const baseURL = window.parent.this.apiUrl; FLOWABLE.CONFIG = { 'onPremise' : true, - 'contextRoot' : 'http://127.0.0.1:8080/workflow/model', - 'contextModelerRestRoot' : 'http://127.0.0.1:8080/workflow/model', - 'webContextRoot' : 'http://127.0.0.1:8080/workflow/model', + 'contextRoot' : baseURL+'/workflow/model', + 'contextModelerRestRoot' : baseURL+'/workflow/model', + 'webContextRoot' : baseURL+'/workflow/model', 'datesLocalization' : false }; diff --git a/public/static/flowable-modeler/scripts/configuration/url-config.js b/public/static/flowable-modeler/scripts/configuration/url-config.js index 88177f9..c06a11d 100644 --- a/public/static/flowable-modeler/scripts/configuration/url-config.js +++ b/public/static/flowable-modeler/scripts/configuration/url-config.js @@ -21,7 +21,7 @@ FLOWABLE.APP_URL = { /* ACCOUNT URLS */ getAccountUrl: function () { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account'; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account?Authorization=Bearer '+window.parent.this.token; }, getLogoutUrl: function () { @@ -35,19 +35,19 @@ FLOWABLE.APP_URL = { }, getModelUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId+'?Authorization=Bearer '+window.parent.this.token; }, getModelModelJsonUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/model-json'; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/model-json?Authorization=Bearer '+window.parent.this.token; }, getModelBpmn20ExportUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/bpmn20?version=' + Date.now(); + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/bpmn20?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; }, getCloneModelsUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/clone'; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/clone'+'?Authorization=Bearer '+window.parent.this.token; }, getModelHistoriesUrl: function (modelId) { diff --git a/src/views/workflow/model/design.vue b/src/views/workflow/model/design.vue index ba0c66d..0400b21 100644 --- a/src/views/workflow/model/design.vue +++ b/src/views/workflow/model/design.vue @@ -7,7 +7,9 @@ - -