form-data 格式值不需要 encode
This commit is contained in:
parent
c0ce3beb8a
commit
352eb5baf7
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "amis",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"description": "一种MIS页面生成工具",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -636,7 +636,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|||
.split('&')
|
||||
.forEach(item => {
|
||||
const parts = item.split('=');
|
||||
fd.append(parts[0], parts[1]);
|
||||
fd.append(parts[0], decodeURIComponent(parts[1]));
|
||||
});
|
||||
|
||||
fd.append(config.fieldName || 'file', file);
|
||||
|
@ -774,7 +774,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
|||
.split('&')
|
||||
.forEach(item => {
|
||||
const parts = item.split('=');
|
||||
fd.append(parts[0], parts[1]);
|
||||
fd.append(parts[0], decodeURIComponent(parts[1]));
|
||||
});
|
||||
|
||||
fd.append('key', state.key);
|
||||
|
|
|
@ -743,7 +743,7 @@ export default class ImageControl extends React.Component<
|
|||
.split('&')
|
||||
.forEach(item => {
|
||||
let parts = item.split('=');
|
||||
fd.append(parts[0], parts[1]);
|
||||
fd.append(parts[0], decodeURIComponent(parts[1]));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1066,7 +1066,8 @@ export function object2formData(
|
|||
.split('&')
|
||||
.forEach(item => {
|
||||
let parts = item.split('=');
|
||||
parts[0] && fd.append(parts[0], parts[1]);
|
||||
// form-data/multipart 是不需要 encode 值的。
|
||||
parts[0] && fd.append(parts[0], decodeURIComponent(parts[1]));
|
||||
});
|
||||
return fd;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue