FIX 当爬虫为空的时候,导致前端列表报错

This commit is contained in:
陈景阳
2019-08-01 11:32:39 +08:00
parent 5853af8b4c
commit a09d2f8b50

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