shindan api失效时提示出错

This commit is contained in:
fumiama 2021-06-03 16:57:36 +08:00
parent b1f4d6fb93
commit 17ab5f1c37

View File

@ -119,6 +119,9 @@ func shindanmaker(id, name string) (string, error) {
return "", err
}
defer resp.Body.Close()
if resp.ContentLength <= 0 {
return "出错啦", nil
}
// 解析XPATH
doc, err := xpath.Parse(resp.Body)
if err != nil {