Skip to content

Commit bf513e7

Browse files
authored
feat(Upload): requestData support array (#2078)
1 parent aa1ba43 commit bf513e7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

js/upload/xhr.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,14 @@ export default function xhr({
8080
// set send data
8181
const formData = new FormData();
8282
Object.keys(requestData).forEach((key) => {
83-
formData.append(key, requestData[key]);
83+
const dataValue = requestData[key];
84+
if (Array.isArray(dataValue)) {
85+
dataValue.forEach((value) => {
86+
formData.append(key, value);
87+
});
88+
} else {
89+
formData.append(key, dataValue);
90+
}
8491
});
8592

8693
xhr.open(method, action, true);

0 commit comments

Comments
 (0)