解决 Cannot read properties of null (reading 'hotgov') 问题
This commit is contained in:
parent
c8958a9de7
commit
45cb904d65
@ -26,7 +26,7 @@ async function main() {
|
|||||||
result = await requestUtils.getApiResult(API_URL);
|
result = await requestUtils.getApiResult(API_URL);
|
||||||
if (result.ok != 1) {
|
if (result.ok != 1) {
|
||||||
console.log(new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString(), SUB_FOLDER, "请求成功,但服务器处理失败,保存失败信息。");
|
console.log(new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString(), SUB_FOLDER, "请求成功,但服务器处理失败,保存失败信息。");
|
||||||
// ok 不为 1,那么久直接保存便于后续分析,不进行后续处理
|
// ok 不为 1,那么就直接保存便于后续分析,不进行后续处理
|
||||||
fileUtils.saveJSON({
|
fileUtils.saveJSON({
|
||||||
saveFolder: DATA_FOLDER,
|
saveFolder: DATA_FOLDER,
|
||||||
now: now,
|
now: now,
|
||||||
@ -56,6 +56,17 @@ async function main() {
|
|||||||
|
|
||||||
let data = JSON.parse(JSON.stringify(result.data));
|
let data = JSON.parse(JSON.stringify(result.data));
|
||||||
|
|
||||||
|
if (!data) {
|
||||||
|
fileUtils.saveJSON({
|
||||||
|
saveFolder: DATA_FOLDER,
|
||||||
|
now: now,
|
||||||
|
fileNameSuffix: `origin--parse-error`,
|
||||||
|
object: result,
|
||||||
|
compress: true,
|
||||||
|
uncompress: false
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过滤掉不需要的数据
|
* 过滤掉不需要的数据
|
||||||
|
Loading…
Reference in New Issue
Block a user