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