zmdms-utils 0.0.46 → 0.0.48

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.
@@ -10,8 +10,8 @@ function getBaseUrl(processObj) {
10
10
  };
11
11
  // 数字中心各个环境地址
12
12
  var cicomsApiBaseUrlObj = {
13
- dev: processObj.REACT_APP_CICOMS_API_DEV || "http://10.100.234.36:8000",
14
- test: processObj.REACT_APP_CICOMS_API_TEST || "http://10.100.234.36:8000",
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
  };
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zmdms-utils",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
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 || "http://10.100.234.36:8000",
16
- test: processObj.REACT_APP_CICOMS_API_TEST || "http://10.100.234.36:8000",
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
  };
package/src/common.ts CHANGED
@@ -283,3 +283,10 @@ export function appendQueryParamsToUrl(url: string, params: any) {
283
283
 
284
284
  return newUrl;
285
285
  }
286
+
287
+ /**
288
+ * 获取数据类型
289
+ */
290
+ export function getDataType(data: any) {
291
+ return Object.prototype.toString.call(data);
292
+ }
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;