Merge pull request #98 from wo10378931/master

FIX 当爬虫为空的时候,导致前端列表报错
This commit is contained in:
Marvin Zhang
2019-08-01 11:39:24 +08:00
committed by GitHub

View File

@@ -99,7 +99,7 @@ func GetSpiderList(filter interface{}, skip int, limit int) ([]Spider, error) {
defer s.Close()
// 获取爬虫列表
var spiders []Spider
spiders := []Spider{}
if err := c.Find(filter).Skip(skip).Limit(limit).All(&spiders); err != nil {
debug.PrintStack()
return spiders, err