mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: 修复分块参数partList错误
This commit is contained in:
parent
1882311269
commit
63c93a922a
@ -1045,16 +1045,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
while (tasks.length) {
|
||||
const res = await Promise.all(
|
||||
tasks.splice(0, concurrency).map(async task => {
|
||||
return await uploadPartFile(state, config)(
|
||||
task,
|
||||
(err: any, value: any) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
throw new Error(err);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
);
|
||||
return await uploadPartFile(state, config)(task);
|
||||
})
|
||||
);
|
||||
results = results.concat(res);
|
||||
@ -1104,7 +1095,7 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
}
|
||||
|
||||
function uploadPartFile(state: ObjectState, conf: Partial<FileProps>) {
|
||||
return (task: Task, callback: (error: any, value?: any) => void) => {
|
||||
return (task: Task) => {
|
||||
const api = buildApi(
|
||||
conf.chunkApi!,
|
||||
createObject(config.data, params),
|
||||
@ -1137,12 +1128,11 @@ export default class FileControl extends React.Component<FileProps, FileState> {
|
||||
)
|
||||
.then(ret => {
|
||||
state.loaded++;
|
||||
callback(null, {
|
||||
return {
|
||||
partNumber: task.partNumber,
|
||||
eTag: (ret.data as any).eTag
|
||||
});
|
||||
})
|
||||
.catch(callback);
|
||||
};
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user