From ff52b17cd466e9ff73e0ba063d28d72c510b50b8 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Thu, 2 Sep 2021 11:17:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dopenapi=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/container.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/models/container.go b/models/container.go index ef693bc..0a638ce 100644 --- a/models/container.go +++ b/models/container.go @@ -359,6 +359,7 @@ func (c *Container) getToken() error { } c.Token, _ = jsonparser.GetString(data, "data", "token") logs.Info(c.Token) + logs.Info("拿2.9的token") } else { return err } @@ -388,11 +389,12 @@ func (c *Container) request(ss ...string) ([]byte, error) { if s == GET || s == POST || s == PUT || s == DELETE { method = s } else if strings.Contains(s, "/api/") { - if c.Version == "2.9" { - api = strings.ReplaceAll(s, "api", "open") - } else { - api = s - } + //if c.Version == "2.9" { + // api = strings.ReplaceAll(s, "api", "open") + //} else { + // api = s + //} + api = s } else { body = s } @@ -510,7 +512,7 @@ func (c *Container) postConfig(handle func(config string) string) error { func (c *Container) getSession() error { if c.Version == "2.9" { - req := httplib.Post(c.Address + "/open/auth") + req := httplib.Post(c.Address + "/auth") req.Param("username", c.Username) req.Param("password", c.Password) rsp, err := req.Response()