mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-11-30 02:58:13 +08:00
fix(module: upload) : determine success based on status==200 (#351)
This commit is contained in:
parent
1877592211
commit
dcbb3d8fbd
@ -84,8 +84,8 @@ export function uploadFile(element, headers, fileId, url, name, instance, percen
|
||||
const req = new XMLHttpRequest()
|
||||
req.onreadystatechange = function () {
|
||||
if (req.readyState === 4) {
|
||||
if (req.responseText == null || req.responseText.length == 0) {
|
||||
instance.invokeMethodAsync(errorMethod, fileId, "error");
|
||||
if (req.status != 200) {
|
||||
instance.invokeMethodAsync(errorMethod, fileId, `{"status": ${req.status}}`);
|
||||
return;
|
||||
}
|
||||
instance.invokeMethodAsync(successMethod, fileId, req.responseText);
|
||||
|
Loading…
Reference in New Issue
Block a user