Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ncov
/
back
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
lintry
2020-01-29 22:50:15 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
afee6766755256e229240786ac234055d9a35733
afee6766
1 parent
28af258b
调整api地址,增加对接口返回值的判断
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletions
server/init/config.js
server/service/data_importer.js
server/init/config.js
View file @
afee676
...
...
@@ -210,7 +210,7 @@ const configure = function () {
// 获取数据的api地址
NCOV
:
{
API_URL
:
'http://lab.isaaclin.cn/nCoV/api/area'
API_URL
:
'http
s
://lab.isaaclin.cn/nCoV/api/area'
}
};
...
...
server/service/data_importer.js
View file @
afee676
...
...
@@ -57,6 +57,10 @@ class DataImporter {
async
import_url
(
url
,
param
)
{
let
json_data
=
await
api_sdk
.
get
(
url
,
param
);
if
(
!
json_data
||
!
json_data
.
results
)
{
logger
.
error
(
'同步数据失败'
,
json_data
)
throw
new
Error
(
'同步数据失败'
);
}
await
this
.
import_data
(
json_data
.
results
||
[]);
}
}
...
...
Please
register
or
login
to post a comment