mirror of
http://git.pig4cloud.com/pig/pigx.git
synced 2026-11-12 05:39:00 +08:00
✨ Introducing new features. #2087 【工作流】模型设计器支持资源服务器鉴权
This commit is contained in:
1 parent
b493ed96b0
commit
9918215509
5 files changed
+35
-7
No files matched your search
-2
@@ -18,7 +18,6 @@
|
||||
package com.pig4cloud.pigx.act.controller;
|
||||
|
||||
import com.pig4cloud.pigx.act.service.EditorService;
|
||||
import com.pig4cloud.pigx.common.security.annotation.Inner;
|
||||
import com.pig4cloud.pigx.common.xss.core.XssCleanIgnore;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -27,7 +26,6 @@ import org.springframework.web.bind.annotation.*;
|
||||
* @author lengleng
|
||||
* @date 2018/4/13
|
||||
*/
|
||||
@Inner(value = false)
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/service")
|
||||
|
||||
@@ -99,12 +99,18 @@ activitiModeler
|
||||
tenantId = JSON.parse(localStorage.getItem('pigx-tenantId')).content
|
||||
}
|
||||
|
||||
var token = ''
|
||||
if (sessionStorage.getItem('pigx-access_token')){
|
||||
token = JSON.parse(sessionStorage.getItem('pigx-access_token')).content
|
||||
}
|
||||
|
||||
var modelUrl = KISBPM.URL.getModel(modelId);
|
||||
|
||||
$http({method: 'GET',
|
||||
url: modelUrl,
|
||||
headers: {
|
||||
'TENANT-ID': tenantId
|
||||
'Authorization': 'Bearer '+token,
|
||||
'TENANT-ID': tenantId
|
||||
}
|
||||
}).
|
||||
success(function (data, status, headers, config) {
|
||||
|
||||
+7
-1
@@ -382,6 +382,11 @@ var SaveModelCtrl = [ '$rootScope', '$scope', '$http', '$route', '$location',
|
||||
tenantId = JSON.parse(localStorage.getItem('pigx-tenantId')).content
|
||||
}
|
||||
|
||||
var token = ''
|
||||
if (sessionStorage.getItem('pigx-access_token')){
|
||||
token = JSON.parse(sessionStorage.getItem('pigx-access_token')).content
|
||||
}
|
||||
|
||||
// Update
|
||||
$http({ method: 'PUT',
|
||||
data: params,
|
||||
@@ -389,7 +394,8 @@ var SaveModelCtrl = [ '$rootScope', '$scope', '$http', '$route', '$location',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
|
||||
'TENANT-ID': tenantId
|
||||
'TENANT-ID': tenantId,
|
||||
'Authorization': 'Bearer '+token,
|
||||
},
|
||||
transformRequest: function (obj) {
|
||||
var str = [];
|
||||
|
||||
+15
-3
@@ -446,7 +446,7 @@ var Enumerable = {
|
||||
iterator(value, index++);
|
||||
});
|
||||
} catch (e) {
|
||||
if (e != $break)
|
||||
if (e != $break)
|
||||
throw e;
|
||||
}
|
||||
return this;
|
||||
@@ -1061,10 +1061,22 @@ Ajax.Request.prototype = Object.extend(new Ajax.Base(), {
|
||||
},
|
||||
|
||||
setRequestHeaders: function() {
|
||||
var tenantId = 1
|
||||
if (localStorage.getItem('pigx-tenantId')) {
|
||||
tenantId = JSON.parse(localStorage.getItem('pigx-tenantId')).content
|
||||
}
|
||||
|
||||
var token = ''
|
||||
if (sessionStorage.getItem('pigx-access_token')){
|
||||
token = JSON.parse(sessionStorage.getItem('pigx-access_token')).content
|
||||
}
|
||||
|
||||
var headers = {
|
||||
'X-Requested-With': 'XMLHttpRequest',
|
||||
'X-Prototype-Version': Prototype.Version,
|
||||
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
|
||||
'Accept': 'text/javascript, text/html, application/xml, text/xml, */*',
|
||||
'TENANT-ID': tenantId,
|
||||
'Authorization': 'Bearer '+token,
|
||||
};
|
||||
|
||||
if (this.method == 'post') {
|
||||
@@ -3269,4 +3281,4 @@ if (Prototype.Browser.WebKit) {
|
||||
}
|
||||
}
|
||||
|
||||
Element.addMethods();
|
||||
Element.addMethods();
|
||||
+6
@@ -67,9 +67,15 @@ angular.module('activitiModeler')
|
||||
tenantId = JSON.parse(localStorage.getItem('pigx-tenantId')).content
|
||||
}
|
||||
|
||||
var token = ''
|
||||
if (sessionStorage.getItem('pigx-access_token')){
|
||||
token = JSON.parse(sessionStorage.getItem('pigx-access_token')).content
|
||||
}
|
||||
|
||||
$http({method: 'GET',
|
||||
url: KISBPM.URL.getStencilSet(),
|
||||
headers: {
|
||||
'Authorization': 'Bearer '+token,
|
||||
'TENANT-ID': tenantId
|
||||
}
|
||||
}).success(function (data, status, headers, config) {
|
||||
|
||||
Reference in new issue
Block a user