ztxkui 4.3.49 → 4.3.50
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/dist/components/utils/fetch.d.ts +4 -0
- package/dist/components/utils/fetch.js +14 -18
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare function customFetch(url: any, options: any): Promise<unknown>;
|
|
2
|
+
export declare function setCatchConfig(config: {
|
|
3
|
+
baseURL?: string;
|
|
4
|
+
url?: string;
|
|
5
|
+
}): void;
|
|
2
6
|
export declare function catchHandle(data: {
|
|
3
7
|
customKey: string;
|
|
4
8
|
customValue: string;
|
|
@@ -58,30 +58,27 @@ export function customFetch(url, options) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
export function setCatchConfig(config) {
|
|
62
|
+
window.localStorage.removeItem('_usercustomurl_');
|
|
63
|
+
window.localStorage.removeItem('_usercustomallurl_');
|
|
64
|
+
if (config.baseURL) {
|
|
65
|
+
window.localStorage.setItem('_usercustomurl_', config.baseURL);
|
|
66
|
+
}
|
|
67
|
+
if (config.url) {
|
|
68
|
+
window.localStorage.setItem('_usercustomallurl_', config.url);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
61
71
|
// 缓存数据变更、新增
|
|
62
72
|
export function catchHandle(data, idKey) {
|
|
63
73
|
// const id = window.localStorage.getItem(idKey);
|
|
64
74
|
var token = getToken();
|
|
65
75
|
var payload = (parseJwt(token) || {}).payload;
|
|
66
|
-
// if (id) {
|
|
67
|
-
// customFetch('/api/zmdms-user/user-custom/update', {
|
|
68
|
-
// method: 'POST',
|
|
69
|
-
// body: JSON.stringify({
|
|
70
|
-
// id,
|
|
71
|
-
// systemCategory: '1',
|
|
72
|
-
// userId: payload?.user_id,
|
|
73
|
-
// userName: payload?.real_name,
|
|
74
|
-
// ...data,
|
|
75
|
-
// }),
|
|
76
|
-
// headers: {
|
|
77
|
-
// 'Content-Type': 'application/json',
|
|
78
|
-
// 'Zmdms-Auth': token,
|
|
79
|
-
// },
|
|
80
|
-
// });
|
|
81
|
-
// } else {
|
|
82
76
|
// 不需要修改
|
|
83
77
|
var userCustomBaseUrl = window.localStorage.getItem('_usercustomurl_');
|
|
84
|
-
|
|
78
|
+
var userCustomAllUrl = window.localStorage.getItem('_usercustomallurl_');
|
|
79
|
+
customFetch(userCustomAllUrl
|
|
80
|
+
? userCustomAllUrl
|
|
81
|
+
: (userCustomBaseUrl ? userCustomBaseUrl : '') + "/api/zmdms-user/user-custom/save", {
|
|
85
82
|
method: 'POST',
|
|
86
83
|
body: JSON.stringify(__assign({ systemCategory: '1', userId: payload === null || payload === void 0 ? void 0 : payload.user_id, userName: payload === null || payload === void 0 ? void 0 : payload.real_name }, data)),
|
|
87
84
|
headers: {
|
|
@@ -89,7 +86,6 @@ export function catchHandle(data, idKey) {
|
|
|
89
86
|
'Zmdms-Auth': token,
|
|
90
87
|
},
|
|
91
88
|
});
|
|
92
|
-
// }
|
|
93
89
|
}
|
|
94
90
|
export function parseJwt(token) {
|
|
95
91
|
try {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export { default as DgColumns } from './components/business/DgColumns';
|
|
|
53
53
|
export { default as message } from './components/basic/message';
|
|
54
54
|
export { default as NumberCase } from './components/NumberCase';
|
|
55
55
|
export { default as EmptyText } from './components/EmptyText';
|
|
56
|
+
export { setCatchConfig } from './components/utils/fetch';
|
|
56
57
|
export { ConfigProvider, Drawer, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tooltip, Descriptions, Image, Popover, Breadcrumb, Transfer, Row, Col, notification, Slider, Rate, Affix, } from 'antd';
|
|
57
58
|
export { default as zhCN } from 'antd/lib/locale/zh_CN';
|
|
58
59
|
export { default as Icon, createFromIconfontCN } from '@ant-design/icons';
|
package/dist/index.js
CHANGED
|
@@ -181,6 +181,7 @@ export { default as DgColumns } from './components/business/DgColumns';
|
|
|
181
181
|
export { default as message } from './components/basic/message';
|
|
182
182
|
export { default as NumberCase } from './components/NumberCase';
|
|
183
183
|
export { default as EmptyText } from './components/EmptyText';
|
|
184
|
+
export { setCatchConfig } from './components/utils/fetch';
|
|
184
185
|
export { ConfigProvider, Drawer, Space, Grid, Divider, Dropdown, Badge, List, Result, Spin, Popconfirm, TreeSelect, Tree, Progress, Cascader, Tooltip, Descriptions, Image, Popover, Breadcrumb, Transfer, Row, Col, notification, Slider, Rate, Affix, } from 'antd';
|
|
185
186
|
export { default as zhCN } from 'antd/lib/locale/zh_CN';
|
|
186
187
|
export { default as Icon, createFromIconfontCN } from '@ant-design/icons';
|