修复可能的报错, 当数据格式不是字符串时

This commit is contained in:
2betop 2020-11-30 14:57:27 +08:00
parent 7cd4b0c8a5
commit 44f46bcfb3

View File

@ -340,7 +340,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
files = (Array.isArray(value)
? value
: joinValues
? (((value as any).value || value) as string).split(delimiter)
? `${(value as any).value || value}`.split(delimiter)
: [((value as any).value || value) as string]
)
.map(item => FileControl.valueToFile(item, props) as FileValue)
@ -883,16 +883,18 @@ export default class FileControl extends React.Component<FileProps, FileState> {
total: tasks.length
};
mapLimit(tasks, 3, uploadPartFile(state, config), function (
err: any,
results: any
) {
if (err) {
reject(err);
} else {
finishChunk(results, state);
mapLimit(
tasks,
3,
uploadPartFile(state, config),
function (err: any, results: any) {
if (err) {
reject(err);
} else {
finishChunk(results, state);
}
}
});
);
}
function updateProgress(partNumber: number, progress: number) {