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 67cf208..4f897cc 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()+'&Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json?version=' + Date.now(); }, getStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/editor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/editor?version=' + Date.now(); }, getCmmnStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/cmmneditor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/cmmneditor?version=' + Date.now(); }, getDmnStencilSet: function() { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/dmneditor?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/stencil-sets/dmneditor?version=' + Date.now(); }, putModel: function(modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json'+'?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/editor/json'; }, validateModel: function(){ - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate'+'?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate'; } }; \ No newline at end of file diff --git a/public/static/flowable-modeler/scripts/common/providers-config.js b/public/static/flowable-modeler/scripts/common/providers-config.js index c5119da..ae0df9d 100644 --- a/public/static/flowable-modeler/scripts/common/providers-config.js +++ b/public/static/flowable-modeler/scripts/common/providers-config.js @@ -40,6 +40,8 @@ flowableModule.config(['$httpProvider', function($httpProvider) { $httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache, no-store, must-revalidate'; $httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; $httpProvider.defaults.headers.get['Expires'] = '0'; + $httpProvider.defaults.headers.get['Authorization'] = 'Bearer '+window.parent.this.token; + $httpProvider.defaults.headers.get['clientid'] = window.parent.this.clientid; $httpProvider.interceptors.push('NotPermittedInterceptor'); diff --git a/public/static/flowable-modeler/scripts/configuration/url-config.js b/public/static/flowable-modeler/scripts/configuration/url-config.js index 76bb74f..c47fe81 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?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account'; }, getLogoutUrl: function () { @@ -35,19 +35,19 @@ FLOWABLE.APP_URL = { }, getModelUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId+'?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId+''; }, getModelModelJsonUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/model-json?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/model-json'; }, getModelBpmn20ExportUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/bpmn20?version=' + Date.now()+'&Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/bpmn20?version=' + Date.now(); }, getCloneModelsUrl: function (modelId) { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/clone'+'?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/models/' + modelId + '/clone'+''; }, getModelHistoriesUrl: function (modelId) { @@ -251,15 +251,15 @@ FLOWABLE.APP_URL = { /* OTHER URLS */ getEditorUsersUrl: function () { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-users?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-users'; }, getEditorGroupsUrl: function () { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-groups?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-groups'; }, getAboutInfoUrl: function () { - return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/about-info?Authorization=Bearer '+window.parent.this.token; + return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/about-info'; } }; diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts index d05e8ac..63225f4 100644 --- a/src/api/workflow/processInstance/index.ts +++ b/src/api/workflow/processInstance/index.ts @@ -32,7 +32,10 @@ export const getProcessInstanceFinishByPage = (query: object) => { * 通过流程实例id获取历史流程图 */ export const getHistoryProcessImage = (processInstanceId: string) => { - return baseUrl + `/workflow/processInstance/getHistoryProcessImage/${processInstanceId}` + '?Authorization=Bearer ' + getToken() + '&t' + Math.random() + return request({ + url: `/workflow/processInstance/getHistoryProcessImage/${processInstanceId}` + '?t' + Math.random(), + method: 'get' + }); }; /** diff --git a/src/components/Process/approvalRecord.vue b/src/components/Process/approvalRecord.vue index 27d1694..cd968df 100644 --- a/src/components/Process/approvalRecord.vue +++ b/src/components/Process/approvalRecord.vue @@ -63,14 +63,14 @@ import { getHistoryProcessImage, getHistoryRecord } from '@/api/workflow/processInstance'; import { ref } from 'vue'; const props = defineProps({ - width: { - type: String, - default: '70%' - }, - height: { - type: String, - default: '100%' - } + width: { + type: String, + default: '70%' + }, + height: { + type: String, + default: '100%' + } }); const loading = ref(false); const src = ref(''); @@ -85,61 +85,63 @@ const graphicX = ref(0); const graphicY = ref(0); //初始化查询审批记录 const init = async (processInstanceId: string) => { - visible.value = true; - loading.value = true; - historyList.value = []; - graphicInfoVos.value = []; - src.value = getHistoryProcessImage(processInstanceId); - getHistoryRecord(processInstanceId).then((response) => { - historyList.value = response.data.historyRecordList; - graphicInfoVos.value = response.data.graphicInfoVos; - nodeListInfo.value = response.data.nodeListInfo; - deleteReason.value = response.data.deleteReason; - loading.value = false; - }); -} + visible.value = true; + loading.value = true; + historyList.value = []; + graphicInfoVos.value = []; + getHistoryProcessImage(processInstanceId).then((res) => { + src.value = 'data:image/png;base64,' + res.data + }); + getHistoryRecord(processInstanceId).then((response) => { + historyList.value = response.data.historyRecordList; + graphicInfoVos.value = response.data.graphicInfoVos; + nodeListInfo.value = response.data.nodeListInfo; + deleteReason.value = response.data.deleteReason; + loading.value = false; + }); +}; //悬浮事件 const handleMouseOver = async (graphic: any) => { - graphicX.value = graphic.x + graphic.width + 10; - graphicY.value = graphic.y - graphic.height + -10; - nodeInfo.value = {}; - if (nodeListInfo.value && nodeListInfo.value.length > 0) { - let info = nodeListInfo.value.find((e: any) => e.taskDefinitionKey == graphic.nodeId); - if (info) { - nodeInfo.value = { - nickName: info.nickName, - status: info.status, - startTime: info.startTime, - endTime: info.endTime, - runDuration: info.runDuration - }; - popupVisible.value = true; - } + graphicX.value = graphic.x + graphic.width + 10; + graphicY.value = graphic.y - graphic.height + -10; + nodeInfo.value = {}; + if (nodeListInfo.value && nodeListInfo.value.length > 0) { + let info = nodeListInfo.value.find((e: any) => e.taskDefinitionKey == graphic.nodeId); + if (info) { + nodeInfo.value = { + nickName: info.nickName, + status: info.status, + startTime: info.startTime, + endTime: info.endTime, + runDuration: info.runDuration + }; + popupVisible.value = true; } -} + } +}; //关闭 const handleMouseLeave = async () => { - popupVisible.value = false; -} + popupVisible.value = false; +}; /** * 对外暴露子组建方法 */ - defineExpose({ +defineExpose({ init }); diff --git a/src/views/workflow/model/design.vue b/src/views/workflow/model/design.vue index d0a7e77..f298026 100644 --- a/src/views/workflow/model/design.vue +++ b/src/views/workflow/model/design.vue @@ -28,7 +28,10 @@ export default { }, token() { return getToken(); - } + }, + clientid() { + return import.meta.env.VITE_APP_CLIENT_ID; + }, }, mounted() { //全局存入当前vue实例