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

解决 Cannot read properties of null (reading 'hotgov') 问题

This commit is contained in:
程序员小墨 2022-08-05 22:42:57 +08:00
parent c8958a9de7
commit 45cb904d65

View File

@ -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;
}
/** /**
* 过滤掉不需要的数据 * 过滤掉不需要的数据