@zat-design/sisyphus-react 3.11.8 → 3.11.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.
@@ -5,32 +5,32 @@ export interface PropsWithMakeFilePropsType {
5
5
  }
6
6
  export interface IDownloadRequestPropsType {
7
7
  /**
8
- * @description 下载请求的地址
9
- * @default (必选)
10
- */
8
+ * @description 下载请求的地址
9
+ * @default (必选)
10
+ */
11
11
  url: string;
12
12
  /**
13
- * @description 下载请求的类型
14
- * @default post
15
- */
13
+ * @description 下载请求的类型
14
+ * @default post
15
+ */
16
16
  method?: 'post' | 'get';
17
17
  /**
18
- * @description 下载所需额外参数或返回上传额外参数的方法
19
- * @default -
20
- */
18
+ * @description 下载所需额外参数或返回上传额外参数的方法
19
+ * @default -
20
+ */
21
21
  params?: any;
22
22
  headers?: any;
23
23
  /** 格式化数据 */
24
24
  transformResponse?: (data: any) => any;
25
25
  /**
26
- * @description service 执行完成时触发
27
- * @default -
28
- */
26
+ * @description service 执行完成时触发
27
+ * @default -
28
+ */
29
29
  onFinish?: (response: object, params: object) => void;
30
30
  /**
31
- * @description 下载保存的文件名
32
- * @default (必选)
33
- */
31
+ * @description 下载保存的文件名
32
+ * @default (必选)
33
+ */
34
34
  fileName?: string;
35
35
  /**
36
36
  * @description 下载出错的回调
@@ -64,7 +64,9 @@ export function getFilenameFromContentDisposition(contentDisposition) {
64
64
  var matches = pattern.exec(contentDisposition);
65
65
  if (matches && matches[1]) {
66
66
  // remove double quotes if filename is quoted
67
- return matches[1].replace(/^"?(.+?)"?$/, '$1');
67
+ // 解码
68
+ var decodeFilename = decodeURIComponent(matches[1]);
69
+ return decodeFilename.replace(/^"?(.+?)"?$/, '$1');
68
70
  }
69
71
  return null;
70
72
  }
@@ -5,32 +5,32 @@ export interface PropsWithMakeFilePropsType {
5
5
  }
6
6
  export interface IDownloadRequestPropsType {
7
7
  /**
8
- * @description 下载请求的地址
9
- * @default (必选)
10
- */
8
+ * @description 下载请求的地址
9
+ * @default (必选)
10
+ */
11
11
  url: string;
12
12
  /**
13
- * @description 下载请求的类型
14
- * @default post
15
- */
13
+ * @description 下载请求的类型
14
+ * @default post
15
+ */
16
16
  method?: 'post' | 'get';
17
17
  /**
18
- * @description 下载所需额外参数或返回上传额外参数的方法
19
- * @default -
20
- */
18
+ * @description 下载所需额外参数或返回上传额外参数的方法
19
+ * @default -
20
+ */
21
21
  params?: any;
22
22
  headers?: any;
23
23
  /** 格式化数据 */
24
24
  transformResponse?: (data: any) => any;
25
25
  /**
26
- * @description service 执行完成时触发
27
- * @default -
28
- */
26
+ * @description service 执行完成时触发
27
+ * @default -
28
+ */
29
29
  onFinish?: (response: object, params: object) => void;
30
30
  /**
31
- * @description 下载保存的文件名
32
- * @default (必选)
33
- */
31
+ * @description 下载保存的文件名
32
+ * @default (必选)
33
+ */
34
34
  fileName?: string;
35
35
  /**
36
36
  * @description 下载出错的回调
@@ -73,7 +73,9 @@ function getFilenameFromContentDisposition(contentDisposition) {
73
73
  var matches = pattern.exec(contentDisposition);
74
74
  if (matches && matches[1]) {
75
75
  // remove double quotes if filename is quoted
76
- return matches[1].replace(/^"?(.+?)"?$/, '$1');
76
+ // 解码
77
+ var decodeFilename = decodeURIComponent(matches[1]);
78
+ return decodeFilename.replace(/^"?(.+?)"?$/, '$1');
77
79
  }
78
80
  return null;
79
81
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.11.8",
3
+ "version": "3.11.9",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",