Commit 1616a06b by zhang Committed by GitHub

perf: 优化多文件上传入参是数组的情况 (#5757)

Co-authored-by: Jin Mao <50581550+jinmao88@users.noreply.github.com>
1 parent 3f0d3089
......@@ -16,7 +16,13 @@ class FileUploader {
const formData = new FormData();
Object.entries(data).forEach(([key, value]) => {
if (Array.isArray(value)) {
value.forEach((item, index) => {
formData.append(`${key}[${index}]`, item);
});
} else {
formData.append(key, value);
}
});
const finalConfig: RequestClientConfig = {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!