@zat-design/sisyphus-react 3.11.6-beta.9 → 3.11.7-beta.1
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
|
-
|
9
|
-
|
10
|
-
|
8
|
+
* @description 下载请求的地址
|
9
|
+
* @default (必选)
|
10
|
+
*/
|
11
11
|
url: string;
|
12
12
|
/**
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
* @description 下载请求的类型
|
14
|
+
* @default post
|
15
|
+
*/
|
16
16
|
method?: 'post' | 'get';
|
17
17
|
/**
|
18
|
-
|
19
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
26
|
+
* @description service 执行完成时触发
|
27
|
+
* @default -
|
28
|
+
*/
|
29
29
|
onFinish?: (response: object, params: object) => void;
|
30
30
|
/**
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
* @description 下载保存的文件名
|
32
|
+
* @default (必选)
|
33
|
+
*/
|
34
34
|
fileName?: string;
|
35
35
|
/**
|
36
36
|
* @description 下载出错的回调
|
package/es/ProDownload/utils.js
CHANGED
@@ -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
|
-
|
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
|
-
|
9
|
-
|
10
|
-
|
8
|
+
* @description 下载请求的地址
|
9
|
+
* @default (必选)
|
10
|
+
*/
|
11
11
|
url: string;
|
12
12
|
/**
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
* @description 下载请求的类型
|
14
|
+
* @default post
|
15
|
+
*/
|
16
16
|
method?: 'post' | 'get';
|
17
17
|
/**
|
18
|
-
|
19
|
-
|
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
|
-
|
27
|
-
|
28
|
-
|
26
|
+
* @description service 执行完成时触发
|
27
|
+
* @default -
|
28
|
+
*/
|
29
29
|
onFinish?: (response: object, params: object) => void;
|
30
30
|
/**
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
* @description 下载保存的文件名
|
32
|
+
* @default (必选)
|
33
|
+
*/
|
34
34
|
fileName?: string;
|
35
35
|
/**
|
36
36
|
* @description 下载出错的回调
|
package/lib/ProDownload/utils.js
CHANGED
@@ -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
|
-
|
76
|
+
// 解码
|
77
|
+
var decodeFilename = decodeURIComponent(matches[1]);
|
78
|
+
return decodeFilename.replace(/^"?(.+?)"?$/, '$1');
|
77
79
|
}
|
78
80
|
return null;
|
79
81
|
}
|
package/package.json
CHANGED