@lambo-design/shared 1.0.0-beta.251 → 1.0.0-beta.252
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/utils/ajax/headers.js +11 -0
- package/utils/ajax/interceptors.js +12 -4
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import qs from 'qs'
|
|
2
2
|
import cacheRules from "./cacheconf";
|
|
3
|
-
import {getToken,getUrlParams} from '../platform'
|
|
3
|
+
import {getLocalStorage, getToken, getUrlParams} from '../platform'
|
|
4
4
|
import Bus from '../bus';
|
|
5
|
-
|
|
5
|
+
import headers from './headers';
|
|
6
6
|
|
|
7
7
|
let timer1, timer2;
|
|
8
8
|
let hasDialog = false;
|
|
@@ -12,13 +12,21 @@ function requestInterceptors(config) {
|
|
|
12
12
|
|
|
13
13
|
let token = getToken();
|
|
14
14
|
if (token) {
|
|
15
|
-
config.headers.token = token;
|
|
15
|
+
config.headers[headers.auth.token] = token;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let systemType = getLocalStorage('systemType')
|
|
19
|
+
let tenantCode = getLocalStorage('tenantCode')
|
|
20
|
+
|
|
21
|
+
if(systemType && tenantCode){
|
|
22
|
+
config.headers[headers.tenant.tenantCode] = tenantCode;
|
|
23
|
+
config.headers[headers.tenant.systemType] = systemType;
|
|
16
24
|
}
|
|
17
25
|
|
|
18
26
|
//sso_token认证
|
|
19
27
|
if (params.hasOwnProperty('sso_token')||sessionStorage.getItem('sso_token')) {
|
|
20
28
|
config.params = Object.assign({
|
|
21
|
-
sso_token: params.sso_token||sessionStorage.getItem('sso_token')
|
|
29
|
+
sso_token: params.sso_token||sessionStorage.getItem('sso_token'),
|
|
22
30
|
sso_id: params.sso_id
|
|
23
31
|
}, config.params)
|
|
24
32
|
}
|