zmdms-utils 0.0.47 → 0.0.49
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/es/baseUrl.d.ts +1 -0
- package/dist/es/baseUrl.js +10 -2
- package/dist/es/common.js +7 -1
- package/dist/es/file.js +7 -0
- package/package.json +1 -1
- package/src/baseUrl.ts +13 -2
- package/src/common.ts +7 -0
- package/src/file.ts +7 -0
package/dist/es/baseUrl.d.ts
CHANGED
package/dist/es/baseUrl.js
CHANGED
|
@@ -10,8 +10,8 @@ function getBaseUrl(processObj) {
|
|
|
10
10
|
};
|
|
11
11
|
// 数字中心各个环境地址
|
|
12
12
|
var cicomsApiBaseUrlObj = {
|
|
13
|
-
dev: processObj.REACT_APP_CICOMS_API_DEV ||
|
|
14
|
-
test: processObj.REACT_APP_CICOMS_API_TEST ||
|
|
13
|
+
dev: processObj.REACT_APP_CICOMS_API_DEV || window.location.origin,
|
|
14
|
+
test: processObj.REACT_APP_CICOMS_API_TEST || window.location.origin,
|
|
15
15
|
stage: processObj.REACT_APP_CICOMS_API_STAGE || window.location.origin,
|
|
16
16
|
product: processObj.REACT_APP_CICOMS_API_PRODUCT || window.location.origin,
|
|
17
17
|
};
|
|
@@ -22,11 +22,19 @@ function getBaseUrl(processObj) {
|
|
|
22
22
|
stage: processObj.REACT_APP_FILE_STAGE || "https://dzfile-prod.zmd.com.cn",
|
|
23
23
|
product: processObj.REACT_APP_FILE_PRODUCT || "https://dzfile.zmd.com.cn:8012",
|
|
24
24
|
};
|
|
25
|
+
// 外网项目各个环境地址
|
|
26
|
+
var outHrDomain = {
|
|
27
|
+
dev: processObj.REACT_APP_OUTHR_API_DEV || "http://192.168.0.134:18886",
|
|
28
|
+
test: processObj.REACT_APP_OUTHR_API_TEST || "http://hr-out.cico.com.cn:30601",
|
|
29
|
+
stage: processObj.REACT_APP_OUTHR_API_STAGE || "http://10.100.234.36:18886",
|
|
30
|
+
product: processObj.REACT_APP_OUTHR_API_PRODUCT || "http://10.100.234.36:18886",
|
|
31
|
+
};
|
|
25
32
|
var currentKey = ENV.toLowerCase() || "dev";
|
|
26
33
|
return {
|
|
27
34
|
API_URL: apiBaseUrlObj[currentKey],
|
|
28
35
|
CICOMS_API_URL: cicomsApiBaseUrlObj[currentKey],
|
|
29
36
|
FILE_URL: fileBaseUrlObj[currentKey],
|
|
37
|
+
OUTHR_DOMAIN: outHrDomain[currentKey],
|
|
30
38
|
};
|
|
31
39
|
}
|
|
32
40
|
|
package/dist/es/common.js
CHANGED
|
@@ -270,5 +270,11 @@ function appendQueryParamsToUrl(url, params) {
|
|
|
270
270
|
});
|
|
271
271
|
return newUrl;
|
|
272
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* 获取数据类型
|
|
275
|
+
*/
|
|
276
|
+
function getDataType(data) {
|
|
277
|
+
return Object.prototype.toString.call(data);
|
|
278
|
+
}
|
|
273
279
|
|
|
274
|
-
export { addThousedSeparator, appendQueryParamsToUrl, copyToClipboard, dangerouslyXss, delay, emitter, getFileExtension, isChinese, isImageExtension, isNonEmpty, parseJoin, parseQueryParams, specialString, unescapeString };
|
|
280
|
+
export { addThousedSeparator, appendQueryParamsToUrl, copyToClipboard, dangerouslyXss, delay, emitter, getDataType, getFileExtension, isChinese, isImageExtension, isNonEmpty, parseJoin, parseQueryParams, specialString, unescapeString };
|
package/dist/es/file.js
CHANGED
|
@@ -168,6 +168,13 @@ function exportBolb(response, fileName) {
|
|
|
168
168
|
var copyName = response.headers["content-disposition"]
|
|
169
169
|
.split(";")[1]
|
|
170
170
|
.split("=")[1];
|
|
171
|
+
// 去除前后引号
|
|
172
|
+
if (copyName.startsWith('"') || copyName.startsWith("'")) {
|
|
173
|
+
copyName = copyName.slice(1);
|
|
174
|
+
}
|
|
175
|
+
if (copyName.endsWith('"') || copyName.endsWith("'")) {
|
|
176
|
+
copyName = copyName.slice(0, -1);
|
|
177
|
+
}
|
|
171
178
|
// 可以自定义名称
|
|
172
179
|
if (fileName) {
|
|
173
180
|
elink.download = fileName;
|
package/package.json
CHANGED
package/src/baseUrl.ts
CHANGED
|
@@ -12,8 +12,8 @@ export function getBaseUrl(processObj: any) {
|
|
|
12
12
|
|
|
13
13
|
// 数字中心各个环境地址
|
|
14
14
|
const cicomsApiBaseUrlObj: any = {
|
|
15
|
-
dev: processObj.REACT_APP_CICOMS_API_DEV ||
|
|
16
|
-
test: processObj.REACT_APP_CICOMS_API_TEST ||
|
|
15
|
+
dev: processObj.REACT_APP_CICOMS_API_DEV || window.location.origin,
|
|
16
|
+
test: processObj.REACT_APP_CICOMS_API_TEST || window.location.origin,
|
|
17
17
|
stage: processObj.REACT_APP_CICOMS_API_STAGE || window.location.origin,
|
|
18
18
|
product: processObj.REACT_APP_CICOMS_API_PRODUCT || window.location.origin,
|
|
19
19
|
};
|
|
@@ -27,11 +27,22 @@ export function getBaseUrl(processObj: any) {
|
|
|
27
27
|
processObj.REACT_APP_FILE_PRODUCT || "https://dzfile.zmd.com.cn:8012",
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
// 外网项目各个环境地址
|
|
31
|
+
const outHrDomain: any = {
|
|
32
|
+
dev: processObj.REACT_APP_OUTHR_API_DEV || "http://192.168.0.134:18886",
|
|
33
|
+
test:
|
|
34
|
+
processObj.REACT_APP_OUTHR_API_TEST || "http://hr-out.cico.com.cn:30601",
|
|
35
|
+
stage: processObj.REACT_APP_OUTHR_API_STAGE || "http://10.100.234.36:18886",
|
|
36
|
+
product:
|
|
37
|
+
processObj.REACT_APP_OUTHR_API_PRODUCT || "http://10.100.234.36:18886",
|
|
38
|
+
};
|
|
39
|
+
|
|
30
40
|
const currentKey = ENV.toLowerCase() || "dev";
|
|
31
41
|
|
|
32
42
|
return {
|
|
33
43
|
API_URL: apiBaseUrlObj[currentKey],
|
|
34
44
|
CICOMS_API_URL: cicomsApiBaseUrlObj[currentKey],
|
|
35
45
|
FILE_URL: fileBaseUrlObj[currentKey],
|
|
46
|
+
OUTHR_DOMAIN: outHrDomain[currentKey],
|
|
36
47
|
};
|
|
37
48
|
}
|
package/src/common.ts
CHANGED
package/src/file.ts
CHANGED
|
@@ -216,6 +216,13 @@ export function exportBolb(response: AxiosResponse, fileName?: string) {
|
|
|
216
216
|
let copyName: string = response.headers["content-disposition"]
|
|
217
217
|
.split(";")[1]
|
|
218
218
|
.split("=")[1];
|
|
219
|
+
// 去除前后引号
|
|
220
|
+
if (copyName.startsWith('"') || copyName.startsWith("'")) {
|
|
221
|
+
copyName = copyName.slice(1);
|
|
222
|
+
}
|
|
223
|
+
if (copyName.endsWith('"') || copyName.endsWith("'")) {
|
|
224
|
+
copyName = copyName.slice(0, -1);
|
|
225
|
+
}
|
|
219
226
|
// 可以自定义名称
|
|
220
227
|
if (fileName) {
|
|
221
228
|
elink.download = fileName;
|