银豹获取cookie修改

This commit is contained in:
苏尹岚
2020-03-30 11:34:38 +08:00
parent bac5ec2659
commit c98396aee4
2 changed files with 10 additions and 6 deletions

View File

@@ -395,14 +395,10 @@ func (a *API) TryGetCookie() (cookie string, err error) {
fmt.Println(utils.Format4Output(cookies, false))
for _, v := range cookies {
if v.Name == ".POSPALAUTH30220" && v.Value != "" {
return v.Value, err
cookie = v.Value
}
}
return errLevel, err
})
return "", err
}
func isErrCookie(err error) {
return cookie, err
}

View File

@@ -76,3 +76,11 @@ func TestSaveProduct(t *testing.T) {
t.Fatal(err)
}
}
func TestTryGetCookie(t *testing.T) {
result, err := api.TryGetCookie()
if err != nil {
t.Fatal(err)
}
t.Log(utils.Format4Output(result, false))
}