请求失败返回 {} 而不是 null,否则后面 result.ok 会报错
This commit is contained in:
parent
dd9e72e16a
commit
6bd81a210f
@ -14,7 +14,7 @@ async function getApiResult(url) {
|
|||||||
} else {
|
} else {
|
||||||
// 请求失败
|
// 请求失败
|
||||||
console.log(`error is ${error}`);
|
console.log(`error is ${error}`);
|
||||||
resolve(null);
|
resolve({});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user