From 752dc1c530bdd6869882487207149eb704d271fd Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Sun, 29 Aug 2021 19:27:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DV2.9=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/container.go | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/models/container.go b/models/container.go index fd9b7d9..ca626a3 100644 --- a/models/container.go +++ b/models/container.go @@ -237,7 +237,7 @@ func (c *Container) read() error { c.Available = true switch c.Type { case "ql": - if c.Version == "2.8" { + if c.Version == "2.9" { type AutoGenerated struct { Code int `json:"code"` Data []struct { @@ -268,39 +268,7 @@ func (c *Container) read() error { } } return nil - } else if c.Version == "2.9"{ - type AutoGenerated struct { - Code int `json:"code"` - Data []struct { - Value string `json:"value"` - ID string `json:"_id"` - Created int64 `json:"created"` - Status int `json:"status"` - Timestamp string `json:"timestamp"` - Position float64 `json:"position"` - Name string `json:"name"` - Remarks string `json:"remarks,omitempty"` - } `json:"data"` - } - var data, err = c.request("/api/envs?searchValue=JD_COOKIE") - a := AutoGenerated{} - err = json.Unmarshal(data, &a) - if err != nil { - c.Available = false - return err - } - c.Delete = []string{} - - for _, env := range a.Data { - c.Delete = append(c.Delete, fmt.Sprintf("\"%s\"", env.ID)) - res := regexp.MustCompile(`pt_key=(\S+);pt_pin=([^\s;]+);?`).FindAllStringSubmatch(env.Value, -1) - for _, v := range res { - CheckIn(v[2], v[1]) - } - } - return nil - } - else { + } else { var data, err = c.request("/api/cookies") if err != nil { c.Available = false