银豹获取cookie修改
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user