1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

请求失败返回 {} 而不是 null,否则后面 result.ok 会报错

This commit is contained in:
程序员小墨 2022-07-30 14:29:34 +08:00
parent dd9e72e16a
commit 6bd81a210f

View File

@ -14,7 +14,7 @@ async function getApiResult(url) {
} else {
// 请求失败
console.log(`error is ${error}`);
resolve(null);
resolve({});
}
});
});