mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:58:05 +08:00
fix: 修复InputFile组件的请求体中包含empty值的问题 (#2625)
This commit is contained in:
parent
608b86f4c0
commit
e1c9f44fa5
@ -356,8 +356,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
if (value && value instanceof Blob) {
|
||||
files = [value as any];
|
||||
} else if (value) {
|
||||
files = (
|
||||
Array.isArray(value)
|
||||
files = (Array.isArray(value)
|
||||
? value
|
||||
: joinValues
|
||||
? `${(value as any)[valueField] || value}`.split(delimiter)
|
||||
@ -403,8 +402,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
let files: Array<FileValue> = [];
|
||||
|
||||
if (value) {
|
||||
files = (
|
||||
Array.isArray(value)
|
||||
files = (Array.isArray(value)
|
||||
? value
|
||||
: joinValues && typeof value === 'string'
|
||||
? value.split(delimiter)
|
||||
@ -884,6 +882,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
|
||||
qsstringify({...api.data, ...params})
|
||||
.split('&')
|
||||
.filter(i => !!i)
|
||||
.forEach(item => {
|
||||
const parts = item.split('=');
|
||||
fd.append(parts[0], decodeURIComponent(parts[1]));
|
||||
|
Loading…
Reference in New Issue
Block a user