fix Cannot read property length of null when first init

This commit is contained in:
zhangweiii
2019-11-27 09:45:16 +08:00
parent e3cc5f33ff
commit 95a1b72ec4
2 changed files with 5 additions and 1 deletions

View File

@@ -116,6 +116,10 @@ func GetSpiderList(filter interface{}, skip int, limit int) ([]Spider, int, erro
return spiders, 0, err
}
if spiders == nil {
spiders = []Spider{}
}
// 遍历爬虫列表
for i, spider := range spiders {
// 获取最后一次任务

View File

@@ -274,7 +274,7 @@ export default {
// 爬虫列表
request.get('/spiders', {})
.then(response => {
this.spiderList = response.data.data.list
this.spiderList = response.data.data.list || []
})
}
}