update 调整设计器请求头

This commit is contained in:
gssong 2023-07-29 13:39:14 +08:00
parent 375a21a300
commit 1367507baf
6 changed files with 74 additions and 64 deletions

View File

@ -15,27 +15,27 @@ var FLOWABLE = FLOWABLE || {};
FLOWABLE.URL = { FLOWABLE.URL = {
getModel: function(modelId) { 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() { 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() { 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() { 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) { 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(){ validateModel: function(){
return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate'+'?Authorization=Bearer '+window.parent.this.token; return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/model/validate';
} }
}; };

View File

@ -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['Cache-Control'] = 'no-cache, no-store, must-revalidate';
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache'; $httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
$httpProvider.defaults.headers.get['Expires'] = '0'; $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'); $httpProvider.interceptors.push('NotPermittedInterceptor');

View File

@ -21,7 +21,7 @@ FLOWABLE.APP_URL = {
/* ACCOUNT URLS */ /* ACCOUNT URLS */
getAccountUrl: function () { getAccountUrl: function () {
return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account?Authorization=Bearer '+window.parent.this.token; return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/account';
}, },
getLogoutUrl: function () { getLogoutUrl: function () {
@ -35,19 +35,19 @@ FLOWABLE.APP_URL = {
}, },
getModelUrl: function (modelId) { 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) { 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) { 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) { 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) { getModelHistoriesUrl: function (modelId) {
@ -251,15 +251,15 @@ FLOWABLE.APP_URL = {
/* OTHER URLS */ /* OTHER URLS */
getEditorUsersUrl: function () { getEditorUsersUrl: function () {
return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-users?Authorization=Bearer '+window.parent.this.token; return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-users';
}, },
getEditorGroupsUrl: function () { getEditorGroupsUrl: function () {
return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-groups?Authorization=Bearer '+window.parent.this.token; return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/editor-groups';
}, },
getAboutInfoUrl: function () { getAboutInfoUrl: function () {
return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/about-info?Authorization=Bearer '+window.parent.this.token; return FLOWABLE.CONFIG.contextModelerRestRoot + '/rest/about-info';
} }
}; };

View File

@ -32,7 +32,10 @@ export const getProcessInstanceFinishByPage = (query: object) => {
* id获取历史流程图 * id获取历史流程图
*/ */
export const getHistoryProcessImage = (processInstanceId: string) => { 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'
});
}; };
/** /**

View File

@ -89,7 +89,9 @@ const init = async (processInstanceId: string) => {
loading.value = true; loading.value = true;
historyList.value = []; historyList.value = [];
graphicInfoVos.value = []; graphicInfoVos.value = [];
src.value = getHistoryProcessImage(processInstanceId); getHistoryProcessImage(processInstanceId).then((res) => {
src.value = 'data:image/png;base64,' + res.data
});
getHistoryRecord(processInstanceId).then((response) => { getHistoryRecord(processInstanceId).then((response) => {
historyList.value = response.data.historyRecordList; historyList.value = response.data.historyRecordList;
graphicInfoVos.value = response.data.graphicInfoVos; graphicInfoVos.value = response.data.graphicInfoVos;
@ -97,7 +99,7 @@ const init = async (processInstanceId: string) => {
deleteReason.value = response.data.deleteReason; deleteReason.value = response.data.deleteReason;
loading.value = false; loading.value = false;
}); });
} };
// //
const handleMouseOver = async (graphic: any) => { const handleMouseOver = async (graphic: any) => {
graphicX.value = graphic.x + graphic.width + 10; graphicX.value = graphic.x + graphic.width + 10;
@ -116,11 +118,11 @@ const handleMouseOver = async (graphic: any) => {
popupVisible.value = true; popupVisible.value = true;
} }
} }
} };
// //
const handleMouseLeave = async () => { const handleMouseLeave = async () => {
popupVisible.value = false; popupVisible.value = false;
} };
/** /**
* 对外暴露子组建方法 * 对外暴露子组建方法
*/ */

View File

@ -28,7 +28,10 @@ export default {
}, },
token() { token() {
return getToken(); return getToken();
} },
clientid() {
return import.meta.env.VITE_APP_CLIENT_ID;
},
}, },
mounted() { mounted() {
//vue //vue