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