@yeeyoon/library 2.9.8 → 2.9.9
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/lib/utils/request.js +8 -0
- package/package.json +2 -2
package/lib/utils/request.js
CHANGED
@@ -4,6 +4,8 @@ import qs from 'qs';
|
|
4
4
|
import ls from 'local-storage';
|
5
5
|
import { notification } from 'antd';
|
6
6
|
|
7
|
+
import { HOST_IAM } from '../config/env';
|
8
|
+
|
7
9
|
const TOKEN_KEY = 'X-Auth-Token';
|
8
10
|
const ID_KEY = 'X-Auth-Id';
|
9
11
|
const REST_KEY = 'Login-Rest-Info';
|
@@ -40,6 +42,11 @@ rest && ls.set(REST_KEY, JSON.stringify(rest));
|
|
40
42
|
// };
|
41
43
|
/** 异常处理程序 */
|
42
44
|
|
45
|
+
const backToIam = () => {
|
46
|
+
const { origin, pathname } = window.location;
|
47
|
+
window.location.href = `${HOST_IAM}?redirect=${origin}${pathname}`;
|
48
|
+
};
|
49
|
+
|
43
50
|
const errorHandler = (error) => {
|
44
51
|
const { response } = error;
|
45
52
|
|
@@ -89,6 +96,7 @@ request.interceptors.response.use(async (response) => {
|
|
89
96
|
m === 'token不一致'
|
90
97
|
) {
|
91
98
|
window.top.postMessage('tcTokenExpired', '*'); // 通知宿主窗口
|
99
|
+
backToIam();
|
92
100
|
}
|
93
101
|
return resp;
|
94
102
|
} else if (success && (!code || code === 200)) {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@yeeyoon/library",
|
3
|
-
"version": "2.9.
|
3
|
+
"version": "2.9.9",
|
4
4
|
"description": "宜云前端组件库和通用服务",
|
5
5
|
"main": "index.js",
|
6
6
|
"repository": {
|
@@ -22,7 +22,7 @@
|
|
22
22
|
"dependencies": {
|
23
23
|
"@ant-design/pro-layout": "^6.26.0",
|
24
24
|
"@ant-design/pro-list": "^1.12.0",
|
25
|
-
"antd": "^4.
|
25
|
+
"antd": "^4.10.0",
|
26
26
|
"dva": "^2.6.0-beta.6",
|
27
27
|
"local-storage": "^2.0.0",
|
28
28
|
"lodash": "^4.17.21",
|