Showing
2 changed files
with
5 additions
and
1 deletions
| ... | @@ -210,7 +210,7 @@ const configure = function () { | ... | @@ -210,7 +210,7 @@ const configure = function () { |
| 210 | 210 | ||
| 211 | // 获取数据的api地址 | 211 | // 获取数据的api地址 |
| 212 | NCOV: { | 212 | NCOV: { |
| 213 | - API_URL: 'http://lab.isaaclin.cn/nCoV/api/area' | 213 | + API_URL: 'https://lab.isaaclin.cn/nCoV/api/area' |
| 214 | } | 214 | } |
| 215 | }; | 215 | }; |
| 216 | 216 | ... | ... |
| ... | @@ -57,6 +57,10 @@ class DataImporter { | ... | @@ -57,6 +57,10 @@ class DataImporter { |
| 57 | 57 | ||
| 58 | async import_url (url, param) { | 58 | async import_url (url, param) { |
| 59 | let json_data = await api_sdk.get(url, param); | 59 | let json_data = await api_sdk.get(url, param); |
| 60 | + if (!json_data || !json_data.results) { | ||
| 61 | + logger.error('同步数据失败', json_data) | ||
| 62 | + throw new Error('同步数据失败'); | ||
| 63 | + } | ||
| 60 | await this.import_data(json_data.results||[]); | 64 | await this.import_data(json_data.results||[]); |
| 61 | } | 65 | } |
| 62 | } | 66 | } | ... | ... |
-
Please register or login to post a comment