szld-libs 0.4.39 → 0.4.41
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/szld-components.es.js +3546 -3534
- package/dist/szld-components.umd.js +29 -29
- package/es/components/DynamicForm/func.js +4 -1
- package/es/components/DynamicFormMobile/func.js +4 -1
- package/es/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/es/components/DynamicFormMobile/useDynamicForm.js +2 -2
- package/es/index.js +19 -8
- package/es/mock/index.js +225 -366
- package/es/utils/method.js +7 -4
- package/es/utils/szxkFunc.d.ts +1 -0
- package/es/utils/szxkFunc.js +10 -1
- package/lib/components/DynamicForm/func.js +4 -1
- package/lib/components/DynamicFormMobile/func.js +4 -1
- package/lib/components/DynamicFormMobile/myCalendar/index.js +4 -2
- package/lib/components/DynamicFormMobile/useDynamicForm.js +2 -2
- package/lib/index.js +17 -6
- package/lib/mock/index.js +225 -366
- package/lib/utils/method.js +7 -4
- package/lib/utils/szxkFunc.d.ts +1 -0
- package/lib/utils/szxkFunc.js +9 -0
- package/package.json +1 -1
- package/es/services/index.d.ts +0 -6
- package/es/services/index.js +0 -83
- package/es/services/request.d.ts +0 -6
- package/es/services/request.js +0 -140
- package/es/services/status.d.ts +0 -1
- package/es/services/status.js +0 -44
- package/es/services/vite.svg +0 -1
- package/lib/services/index.d.ts +0 -6
- package/lib/services/index.js +0 -83
- package/lib/services/request.d.ts +0 -6
- package/lib/services/request.js +0 -140
- package/lib/services/status.d.ts +0 -1
- package/lib/services/status.js +0 -44
- package/lib/services/vite.svg +0 -1
package/lib/utils/method.js
CHANGED
|
@@ -162,18 +162,21 @@ const handleSubmitForm = (originalData, allValues) => {
|
|
|
162
162
|
}
|
|
163
163
|
if (isAutoFill) {
|
|
164
164
|
(_a = updatedData == null ? void 0 : updatedData.attr_list) == null ? void 0 : _a.forEach((v) => {
|
|
165
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
165
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
166
166
|
const attrvalue = (v == null ? void 0 : v.attrvalue) || "";
|
|
167
167
|
if (((_a2 = v == null ? void 0 : v.json) == null ? void 0 : _a2["auto-generate"]) && ((_b = v == null ? void 0 : v.json) == null ? void 0 : _b["auto-generate-type"]) && !attrvalue) {
|
|
168
168
|
if (((_c = v == null ? void 0 : v.json) == null ? void 0 : _c["auto-generate-type"]) === "currenttime") {
|
|
169
169
|
v.attrvalue = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
170
170
|
}
|
|
171
|
-
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "
|
|
171
|
+
if (((_d = v == null ? void 0 : v.json) == null ? void 0 : _d["auto-generate-type"]) === "currenttimestamp") {
|
|
172
|
+
v.attrvalue = dayjs().unix().toString();
|
|
173
|
+
}
|
|
174
|
+
if (((_e = v == null ? void 0 : v.json) == null ? void 0 : _e["auto-generate-type"]) === "guid" && !attrvalue) {
|
|
172
175
|
v.attrvalue = onlyNumber || guid || "";
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
|
-
if (((
|
|
176
|
-
v.attrvalue = (
|
|
178
|
+
if (((_f = v == null ? void 0 : v.json) == null ? void 0 : _f["default"]) && !attrvalue) {
|
|
179
|
+
v.attrvalue = (_g = v == null ? void 0 : v.json) == null ? void 0 : _g["default"];
|
|
177
180
|
}
|
|
178
181
|
});
|
|
179
182
|
}
|
package/lib/utils/szxkFunc.d.ts
CHANGED
|
@@ -69,3 +69,4 @@ export declare const handleSetTableRowColor: (record: any, index: number | undef
|
|
|
69
69
|
export declare const handleFormatMobileDate: (values: Record<string, any>, format?: string) => Record<string, any>;
|
|
70
70
|
export declare const handleNonUniversalHeader: (nonUniversalHeader: Record<string, string>, data: Record<string, any>) => Record<string, any>;
|
|
71
71
|
export declare const handleGetControlPanelConfig: (sourceNumber: string | number, commonRequest: (InterfaceType: string, data?: any) => Promise<AxiosResponse<any, any>>) => Promise<any>;
|
|
72
|
+
export declare const isJson: (str: string) => boolean;
|
package/lib/utils/szxkFunc.js
CHANGED
|
@@ -100,6 +100,14 @@ const handleGetControlPanelConfig = async (sourceNumber, commonRequest) => {
|
|
|
100
100
|
} catch (error) {
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
+
const isJson = (str) => {
|
|
104
|
+
try {
|
|
105
|
+
JSON.parse(str);
|
|
106
|
+
return true;
|
|
107
|
+
} catch (e) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
103
111
|
exports.handleCallSupportCode = handleCallSupportCode;
|
|
104
112
|
exports.handleFormatMobileDate = handleFormatMobileDate;
|
|
105
113
|
exports.handleGetAttrDetail = handleGetAttrDetail;
|
|
@@ -109,3 +117,4 @@ exports.handleGetList = handleGetList;
|
|
|
109
117
|
exports.handleNonUniversalHeader = handleNonUniversalHeader;
|
|
110
118
|
exports.handleObjDetailToSignleAttrList = handleObjDetailToSignleAttrList;
|
|
111
119
|
exports.handleSetTableRowColor = handleSetTableRowColor;
|
|
120
|
+
exports.isJson = isJson;
|
package/package.json
CHANGED
package/es/services/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const commonRequest: (InterfaceType: string, data?: any) => Promise<any>;
|
|
2
|
-
export declare const commonRequestDic: (data?: any) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
3
|
-
export declare const commonRequestWidthParams: (params: object, data?: any) => Promise<any>;
|
|
4
|
-
export declare const commonRequestActionUrl: (data?: any) => Promise<any>;
|
|
5
|
-
export declare const uploadAction: () => string;
|
|
6
|
-
export declare const uploadFormAction: () => string;
|
package/es/services/index.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import queryString from "query-string";
|
|
2
|
-
import request, { domainSetting } from "./request";
|
|
3
|
-
import { TOKEN, encryptParamStrings } from "../utils/enum";
|
|
4
|
-
import { HmacSHA512 } from "../main";
|
|
5
|
-
const commonRequest = async (InterfaceType, data) => {
|
|
6
|
-
return request.post("", data, {
|
|
7
|
-
params: {
|
|
8
|
-
PageName: "dns_relay",
|
|
9
|
-
Controlname: "Connon_Control",
|
|
10
|
-
InterfaceType
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
const commonRequestDic = async (data) => {
|
|
15
|
-
return request.post("", data, {
|
|
16
|
-
params: {
|
|
17
|
-
PageName: "DicInterface",
|
|
18
|
-
Controlname: "SelectDic"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
const commonRequestWidthParams = async (params, data) => {
|
|
23
|
-
return request.post("", data, {
|
|
24
|
-
params
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
const commonRequestActionUrl = async (data) => {
|
|
28
|
-
return request.post("", data, {
|
|
29
|
-
params: {
|
|
30
|
-
PageName: "dns_relay",
|
|
31
|
-
Controlname: "CallActionUrl",
|
|
32
|
-
InterfaceType: "DPGLSysemName"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
const uploadAction = () => {
|
|
37
|
-
const SessionID = sessionStorage.getItem(TOKEN);
|
|
38
|
-
const params = {
|
|
39
|
-
...domainSetting.baseParams,
|
|
40
|
-
PageName: "dns_relay",
|
|
41
|
-
return: true,
|
|
42
|
-
Controlname: "UpSingleFile",
|
|
43
|
-
InterfaceType: "",
|
|
44
|
-
udmfile: "file",
|
|
45
|
-
SessionID
|
|
46
|
-
};
|
|
47
|
-
const obj = {};
|
|
48
|
-
encryptParamStrings.forEach((key) => {
|
|
49
|
-
obj[key] = params[key] || "";
|
|
50
|
-
});
|
|
51
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
52
|
-
const sha = new HmacSHA512("HnSzldjt#2557013#");
|
|
53
|
-
params["TokenId"] = sha.encrypt(encryptParams);
|
|
54
|
-
return domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
55
|
-
};
|
|
56
|
-
const uploadFormAction = () => {
|
|
57
|
-
const SessionID = sessionStorage.getItem(TOKEN);
|
|
58
|
-
const params = {
|
|
59
|
-
...domainSetting.baseParams,
|
|
60
|
-
PageName: "initializationfile",
|
|
61
|
-
return: true,
|
|
62
|
-
Controlname: "UpSingleFile",
|
|
63
|
-
InterfaceType: "",
|
|
64
|
-
udmfile: "file",
|
|
65
|
-
SessionID
|
|
66
|
-
};
|
|
67
|
-
const obj = {};
|
|
68
|
-
encryptParamStrings.forEach((key) => {
|
|
69
|
-
obj[key] = params[key] || "";
|
|
70
|
-
});
|
|
71
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
72
|
-
const sha = new HmacSHA512("HnSzldjt#2557013#");
|
|
73
|
-
params["TokenId"] = sha.encrypt(encryptParams);
|
|
74
|
-
return domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
commonRequest,
|
|
78
|
-
commonRequestActionUrl,
|
|
79
|
-
commonRequestDic,
|
|
80
|
-
commonRequestWidthParams,
|
|
81
|
-
uploadAction,
|
|
82
|
-
uploadFormAction
|
|
83
|
-
};
|
package/es/services/request.d.ts
DELETED
package/es/services/request.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
var _a, _b;
|
|
2
|
-
import { OEID, TOKEN, encryptParamStrings, USERINFO } from "../utils/enum";
|
|
3
|
-
import { message } from "antd";
|
|
4
|
-
import axios from "axios";
|
|
5
|
-
import _ from "lodash";
|
|
6
|
-
import queryString from "query-string";
|
|
7
|
-
import { HmacSHA512, utils } from "szld-libs";
|
|
8
|
-
import { showStatus } from "./status";
|
|
9
|
-
const { removeSessionStorage, getSessionStorage } = utils;
|
|
10
|
-
const env = {}.VITE_BUILD_ENV;
|
|
11
|
-
const domainSetting = {
|
|
12
|
-
baseUrl: "",
|
|
13
|
-
baseParams: {}
|
|
14
|
-
};
|
|
15
|
-
if (env === "test" || env === "dev") {
|
|
16
|
-
domainSetting.baseUrl = "/ucc";
|
|
17
|
-
domainSetting.baseParams = {
|
|
18
|
-
AppID: "KF_SZLD_DDGLXT",
|
|
19
|
-
Password: "KF_SZLD_DDGLXT2557013"
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
if (env === "dev") {
|
|
23
|
-
domainSetting.baseUrl = "/api";
|
|
24
|
-
}
|
|
25
|
-
if (env === "production") {
|
|
26
|
-
domainSetting.baseUrl = "/ucc";
|
|
27
|
-
domainSetting.baseParams = {
|
|
28
|
-
AppID: (_a = window == null ? void 0 : window.CONFIG) == null ? void 0 : _a.AppID,
|
|
29
|
-
Password: (_b = window == null ? void 0 : window.CONFIG) == null ? void 0 : _b.Password
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const request = axios.create({
|
|
33
|
-
baseURL: domainSetting.baseUrl,
|
|
34
|
-
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
35
|
-
withCredentials: true,
|
|
36
|
-
timeout: 3e5,
|
|
37
|
-
params: {
|
|
38
|
-
return: true,
|
|
39
|
-
...domainSetting.baseParams
|
|
40
|
-
},
|
|
41
|
-
transformRequest: [
|
|
42
|
-
(data) => {
|
|
43
|
-
data = JSON.stringify(data);
|
|
44
|
-
return data;
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
});
|
|
48
|
-
request.interceptors.request.use(
|
|
49
|
-
function(config) {
|
|
50
|
-
var _a2;
|
|
51
|
-
const oeid = sessionStorage.getItem(OEID);
|
|
52
|
-
if (oeid) {
|
|
53
|
-
config.data = {
|
|
54
|
-
...(config == null ? void 0 : config.data) || {},
|
|
55
|
-
oeid
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
const token = sessionStorage.getItem(TOKEN);
|
|
59
|
-
if (token) {
|
|
60
|
-
const types = ["GetVCode", "FirstLoginUpdateMM", "DPGLSystemName"];
|
|
61
|
-
const names = ["Login"];
|
|
62
|
-
if (!names.includes(config.params["Controlname"]) && !types.includes(config.params["InterfaceType"])) {
|
|
63
|
-
config.params["SessionID"] = token;
|
|
64
|
-
config.params["InterfaceType"] = config.params["InterfaceType"] || "";
|
|
65
|
-
const obj = {};
|
|
66
|
-
encryptParamStrings.forEach((key) => {
|
|
67
|
-
obj[key] = config.params[key] || "";
|
|
68
|
-
});
|
|
69
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
70
|
-
const sha = new HmacSHA512((_a2 = window == null ? void 0 : window.CONFIG) == null ? void 0 : _a2.Salt);
|
|
71
|
-
config.params["TokenId"] = sha.encrypt(encryptParams);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return config;
|
|
75
|
-
},
|
|
76
|
-
function(error) {
|
|
77
|
-
return Promise.reject(error);
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
request.interceptors.response.use(
|
|
81
|
-
function(response) {
|
|
82
|
-
var _a2;
|
|
83
|
-
const status = response.status;
|
|
84
|
-
if (status < 200 || status >= 300) {
|
|
85
|
-
const msg = showStatus(status);
|
|
86
|
-
if (typeof response.data === "string") {
|
|
87
|
-
response.data = { msg };
|
|
88
|
-
} else {
|
|
89
|
-
response.data = {
|
|
90
|
-
data: response.data,
|
|
91
|
-
msg
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
msgError(response.data.msg);
|
|
95
|
-
Promise.reject(response);
|
|
96
|
-
return {
|
|
97
|
-
ReturnValue: 0,
|
|
98
|
-
...response.data
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
if (typeof response.data === "string" && response.data.includes("Invalid")) {
|
|
102
|
-
msgError("登录已失效,请重新登录");
|
|
103
|
-
removeSessionStorage(USERINFO);
|
|
104
|
-
removeSessionStorage(TOKEN);
|
|
105
|
-
Promise.reject(response);
|
|
106
|
-
return {
|
|
107
|
-
ReturnValue: 0,
|
|
108
|
-
msg: "登录已失效,请重新登录",
|
|
109
|
-
data: response.data
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
const result = response.data;
|
|
113
|
-
const noHitControlList = [];
|
|
114
|
-
if (_.isNumber(result == null ? void 0 : result.ReturnValue) && result.ReturnValue !== 1) {
|
|
115
|
-
if (!noHitControlList.includes((_a2 = response.config) == null ? void 0 : _a2.params["Controlname"])) {
|
|
116
|
-
msgError(result.msg);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
return result;
|
|
120
|
-
},
|
|
121
|
-
function(error) {
|
|
122
|
-
msgError("请求出错");
|
|
123
|
-
Promise.reject(error);
|
|
124
|
-
return {
|
|
125
|
-
ReturnValue: 0,
|
|
126
|
-
msg: "请求出错",
|
|
127
|
-
data: error
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
const msgError = (content) => {
|
|
132
|
-
message.error({
|
|
133
|
-
content,
|
|
134
|
-
key: "globalError"
|
|
135
|
-
});
|
|
136
|
-
};
|
|
137
|
-
export {
|
|
138
|
-
request as default,
|
|
139
|
-
domainSetting
|
|
140
|
-
};
|
package/es/services/status.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const showStatus: (status: number) => string;
|
package/es/services/status.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
const showStatus = (status) => {
|
|
2
|
-
let message = "";
|
|
3
|
-
switch (status) {
|
|
4
|
-
case 400:
|
|
5
|
-
message = "请求错误(400)";
|
|
6
|
-
break;
|
|
7
|
-
case 401:
|
|
8
|
-
message = "未授权,请重新登录(401)";
|
|
9
|
-
break;
|
|
10
|
-
case 403:
|
|
11
|
-
message = "拒绝访问(403)";
|
|
12
|
-
break;
|
|
13
|
-
case 404:
|
|
14
|
-
message = "请求出错(404)";
|
|
15
|
-
break;
|
|
16
|
-
case 408:
|
|
17
|
-
message = "请求超时(408)";
|
|
18
|
-
break;
|
|
19
|
-
case 500:
|
|
20
|
-
message = "服务器错误(500)";
|
|
21
|
-
break;
|
|
22
|
-
case 501:
|
|
23
|
-
message = "服务未实现(501)";
|
|
24
|
-
break;
|
|
25
|
-
case 502:
|
|
26
|
-
message = "网络错误(502)";
|
|
27
|
-
break;
|
|
28
|
-
case 503:
|
|
29
|
-
message = "服务不可用(503)";
|
|
30
|
-
break;
|
|
31
|
-
case 504:
|
|
32
|
-
message = "网络超时(504)";
|
|
33
|
-
break;
|
|
34
|
-
case 505:
|
|
35
|
-
message = "HTTP版本不受支持(505)";
|
|
36
|
-
break;
|
|
37
|
-
default:
|
|
38
|
-
message = `连接出错(${status})!`;
|
|
39
|
-
}
|
|
40
|
-
return `${message},请检查网络或联系管理员!`;
|
|
41
|
-
};
|
|
42
|
-
export {
|
|
43
|
-
showStatus
|
|
44
|
-
};
|
package/es/services/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/lib/services/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const commonRequest: (InterfaceType: string, data?: any) => Promise<any>;
|
|
2
|
-
export declare const commonRequestDic: (data?: any) => Promise<import("axios").AxiosResponse<any, any, {}>>;
|
|
3
|
-
export declare const commonRequestWidthParams: (params: object, data?: any) => Promise<any>;
|
|
4
|
-
export declare const commonRequestActionUrl: (data?: any) => Promise<any>;
|
|
5
|
-
export declare const uploadAction: () => string;
|
|
6
|
-
export declare const uploadFormAction: () => string;
|
package/lib/services/index.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const queryString = require("query-string");
|
|
4
|
-
const request = require("./request");
|
|
5
|
-
const _enum = require("../utils/enum");
|
|
6
|
-
const main = require("../main");
|
|
7
|
-
const commonRequest = async (InterfaceType, data) => {
|
|
8
|
-
return request.post("", data, {
|
|
9
|
-
params: {
|
|
10
|
-
PageName: "dns_relay",
|
|
11
|
-
Controlname: "Connon_Control",
|
|
12
|
-
InterfaceType
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
const commonRequestDic = async (data) => {
|
|
17
|
-
return request.post("", data, {
|
|
18
|
-
params: {
|
|
19
|
-
PageName: "DicInterface",
|
|
20
|
-
Controlname: "SelectDic"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
const commonRequestWidthParams = async (params, data) => {
|
|
25
|
-
return request.post("", data, {
|
|
26
|
-
params
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
const commonRequestActionUrl = async (data) => {
|
|
30
|
-
return request.post("", data, {
|
|
31
|
-
params: {
|
|
32
|
-
PageName: "dns_relay",
|
|
33
|
-
Controlname: "CallActionUrl",
|
|
34
|
-
InterfaceType: "DPGLSysemName"
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
const uploadAction = () => {
|
|
39
|
-
const SessionID = sessionStorage.getItem(_enum.TOKEN);
|
|
40
|
-
const params = {
|
|
41
|
-
...request.domainSetting.baseParams,
|
|
42
|
-
PageName: "dns_relay",
|
|
43
|
-
return: true,
|
|
44
|
-
Controlname: "UpSingleFile",
|
|
45
|
-
InterfaceType: "",
|
|
46
|
-
udmfile: "file",
|
|
47
|
-
SessionID
|
|
48
|
-
};
|
|
49
|
-
const obj = {};
|
|
50
|
-
_enum.encryptParamStrings.forEach((key) => {
|
|
51
|
-
obj[key] = params[key] || "";
|
|
52
|
-
});
|
|
53
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
54
|
-
const sha = new main.HmacSHA512("HnSzldjt#2557013#");
|
|
55
|
-
params["TokenId"] = sha.encrypt(encryptParams);
|
|
56
|
-
return request.domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
57
|
-
};
|
|
58
|
-
const uploadFormAction = () => {
|
|
59
|
-
const SessionID = sessionStorage.getItem(_enum.TOKEN);
|
|
60
|
-
const params = {
|
|
61
|
-
...request.domainSetting.baseParams,
|
|
62
|
-
PageName: "initializationfile",
|
|
63
|
-
return: true,
|
|
64
|
-
Controlname: "UpSingleFile",
|
|
65
|
-
InterfaceType: "",
|
|
66
|
-
udmfile: "file",
|
|
67
|
-
SessionID
|
|
68
|
-
};
|
|
69
|
-
const obj = {};
|
|
70
|
-
_enum.encryptParamStrings.forEach((key) => {
|
|
71
|
-
obj[key] = params[key] || "";
|
|
72
|
-
});
|
|
73
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
74
|
-
const sha = new main.HmacSHA512("HnSzldjt#2557013#");
|
|
75
|
-
params["TokenId"] = sha.encrypt(encryptParams);
|
|
76
|
-
return request.domainSetting.baseUrl + "?" + queryString.stringify(params);
|
|
77
|
-
};
|
|
78
|
-
exports.commonRequest = commonRequest;
|
|
79
|
-
exports.commonRequestActionUrl = commonRequestActionUrl;
|
|
80
|
-
exports.commonRequestDic = commonRequestDic;
|
|
81
|
-
exports.commonRequestWidthParams = commonRequestWidthParams;
|
|
82
|
-
exports.uploadAction = uploadAction;
|
|
83
|
-
exports.uploadFormAction = uploadFormAction;
|
package/lib/services/request.js
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a, _b;
|
|
3
|
-
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
-
const _enum = require("../utils/enum");
|
|
5
|
-
const antd = require("antd");
|
|
6
|
-
const axios = require("axios");
|
|
7
|
-
const _ = require("lodash");
|
|
8
|
-
const queryString = require("query-string");
|
|
9
|
-
const szldLibs = require("szld-libs");
|
|
10
|
-
const status = require("./status");
|
|
11
|
-
const { removeSessionStorage, getSessionStorage } = szldLibs.utils;
|
|
12
|
-
const env = {}.VITE_BUILD_ENV;
|
|
13
|
-
const domainSetting = {
|
|
14
|
-
baseUrl: "",
|
|
15
|
-
baseParams: {}
|
|
16
|
-
};
|
|
17
|
-
if (env === "test" || env === "dev") {
|
|
18
|
-
domainSetting.baseUrl = "/ucc";
|
|
19
|
-
domainSetting.baseParams = {
|
|
20
|
-
AppID: "KF_SZLD_DDGLXT",
|
|
21
|
-
Password: "KF_SZLD_DDGLXT2557013"
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
if (env === "dev") {
|
|
25
|
-
domainSetting.baseUrl = "/api";
|
|
26
|
-
}
|
|
27
|
-
if (env === "production") {
|
|
28
|
-
domainSetting.baseUrl = "/ucc";
|
|
29
|
-
domainSetting.baseParams = {
|
|
30
|
-
AppID: (_a = window == null ? void 0 : window.CONFIG) == null ? void 0 : _a.AppID,
|
|
31
|
-
Password: (_b = window == null ? void 0 : window.CONFIG) == null ? void 0 : _b.Password
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
const request = axios.create({
|
|
35
|
-
baseURL: domainSetting.baseUrl,
|
|
36
|
-
headers: { "Content-Type": "application/json;charset=utf-8" },
|
|
37
|
-
withCredentials: true,
|
|
38
|
-
timeout: 3e5,
|
|
39
|
-
params: {
|
|
40
|
-
return: true,
|
|
41
|
-
...domainSetting.baseParams
|
|
42
|
-
},
|
|
43
|
-
transformRequest: [
|
|
44
|
-
(data) => {
|
|
45
|
-
data = JSON.stringify(data);
|
|
46
|
-
return data;
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
});
|
|
50
|
-
request.interceptors.request.use(
|
|
51
|
-
function(config) {
|
|
52
|
-
var _a2;
|
|
53
|
-
const oeid = sessionStorage.getItem(_enum.OEID);
|
|
54
|
-
if (oeid) {
|
|
55
|
-
config.data = {
|
|
56
|
-
...(config == null ? void 0 : config.data) || {},
|
|
57
|
-
oeid
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
const token = sessionStorage.getItem(_enum.TOKEN);
|
|
61
|
-
if (token) {
|
|
62
|
-
const types = ["GetVCode", "FirstLoginUpdateMM", "DPGLSystemName"];
|
|
63
|
-
const names = ["Login"];
|
|
64
|
-
if (!names.includes(config.params["Controlname"]) && !types.includes(config.params["InterfaceType"])) {
|
|
65
|
-
config.params["SessionID"] = token;
|
|
66
|
-
config.params["InterfaceType"] = config.params["InterfaceType"] || "";
|
|
67
|
-
const obj = {};
|
|
68
|
-
_enum.encryptParamStrings.forEach((key) => {
|
|
69
|
-
obj[key] = config.params[key] || "";
|
|
70
|
-
});
|
|
71
|
-
const encryptParams = queryString.stringify(obj, { sort: false });
|
|
72
|
-
const sha = new szldLibs.HmacSHA512((_a2 = window == null ? void 0 : window.CONFIG) == null ? void 0 : _a2.Salt);
|
|
73
|
-
config.params["TokenId"] = sha.encrypt(encryptParams);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return config;
|
|
77
|
-
},
|
|
78
|
-
function(error) {
|
|
79
|
-
return Promise.reject(error);
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
request.interceptors.response.use(
|
|
83
|
-
function(response) {
|
|
84
|
-
var _a2;
|
|
85
|
-
const status$1 = response.status;
|
|
86
|
-
if (status$1 < 200 || status$1 >= 300) {
|
|
87
|
-
const msg = status.showStatus(status$1);
|
|
88
|
-
if (typeof response.data === "string") {
|
|
89
|
-
response.data = { msg };
|
|
90
|
-
} else {
|
|
91
|
-
response.data = {
|
|
92
|
-
data: response.data,
|
|
93
|
-
msg
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
msgError(response.data.msg);
|
|
97
|
-
Promise.reject(response);
|
|
98
|
-
return {
|
|
99
|
-
ReturnValue: 0,
|
|
100
|
-
...response.data
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
if (typeof response.data === "string" && response.data.includes("Invalid")) {
|
|
104
|
-
msgError("登录已失效,请重新登录");
|
|
105
|
-
removeSessionStorage(_enum.USERINFO);
|
|
106
|
-
removeSessionStorage(_enum.TOKEN);
|
|
107
|
-
Promise.reject(response);
|
|
108
|
-
return {
|
|
109
|
-
ReturnValue: 0,
|
|
110
|
-
msg: "登录已失效,请重新登录",
|
|
111
|
-
data: response.data
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
const result = response.data;
|
|
115
|
-
const noHitControlList = [];
|
|
116
|
-
if (_.isNumber(result == null ? void 0 : result.ReturnValue) && result.ReturnValue !== 1) {
|
|
117
|
-
if (!noHitControlList.includes((_a2 = response.config) == null ? void 0 : _a2.params["Controlname"])) {
|
|
118
|
-
msgError(result.msg);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return result;
|
|
122
|
-
},
|
|
123
|
-
function(error) {
|
|
124
|
-
msgError("请求出错");
|
|
125
|
-
Promise.reject(error);
|
|
126
|
-
return {
|
|
127
|
-
ReturnValue: 0,
|
|
128
|
-
msg: "请求出错",
|
|
129
|
-
data: error
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
);
|
|
133
|
-
const msgError = (content) => {
|
|
134
|
-
antd.message.error({
|
|
135
|
-
content,
|
|
136
|
-
key: "globalError"
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
exports.default = request;
|
|
140
|
-
exports.domainSetting = domainSetting;
|
package/lib/services/status.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const showStatus: (status: number) => string;
|
package/lib/services/status.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const showStatus = (status) => {
|
|
4
|
-
let message = "";
|
|
5
|
-
switch (status) {
|
|
6
|
-
case 400:
|
|
7
|
-
message = "请求错误(400)";
|
|
8
|
-
break;
|
|
9
|
-
case 401:
|
|
10
|
-
message = "未授权,请重新登录(401)";
|
|
11
|
-
break;
|
|
12
|
-
case 403:
|
|
13
|
-
message = "拒绝访问(403)";
|
|
14
|
-
break;
|
|
15
|
-
case 404:
|
|
16
|
-
message = "请求出错(404)";
|
|
17
|
-
break;
|
|
18
|
-
case 408:
|
|
19
|
-
message = "请求超时(408)";
|
|
20
|
-
break;
|
|
21
|
-
case 500:
|
|
22
|
-
message = "服务器错误(500)";
|
|
23
|
-
break;
|
|
24
|
-
case 501:
|
|
25
|
-
message = "服务未实现(501)";
|
|
26
|
-
break;
|
|
27
|
-
case 502:
|
|
28
|
-
message = "网络错误(502)";
|
|
29
|
-
break;
|
|
30
|
-
case 503:
|
|
31
|
-
message = "服务不可用(503)";
|
|
32
|
-
break;
|
|
33
|
-
case 504:
|
|
34
|
-
message = "网络超时(504)";
|
|
35
|
-
break;
|
|
36
|
-
case 505:
|
|
37
|
-
message = "HTTP版本不受支持(505)";
|
|
38
|
-
break;
|
|
39
|
-
default:
|
|
40
|
-
message = `连接出错(${status})!`;
|
|
41
|
-
}
|
|
42
|
-
return `${message},请检查网络或联系管理员!`;
|
|
43
|
-
};
|
|
44
|
-
exports.showStatus = showStatus;
|
package/lib/services/vite.svg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|