fix(components): upload headers add type judge (#4119)

This commit is contained in:
btea 2021-10-30 10:37:44 -05:00 committed by GitHub
parent c1bfe08c21
commit 4c698be458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -92,9 +92,11 @@ export default function upload(option: ElUploadRequestOptions) {
}
}
headers.forEach((value, key) => {
xhr.setRequestHeader(key, value)
})
if (headers instanceof Headers) {
headers.forEach((value, key) => {
xhr.setRequestHeader(key, value)
})
}
xhr.send(formData)
return xhr