全面兼容新版V4 需要旧版的请看readme 不做兼容谢谢 考虑上QL2.9.X

This commit is contained in:
ZJY 2021-09-08 17:48:38 +08:00
parent 399a0228f2
commit 27d80a1ebb
2 changed files with 10 additions and 10 deletions

View File

@ -541,12 +541,9 @@ func (c *Container) postConfig(handle func(config string) string) error {
req.Header("Cookie", c.Token)
req.Param("content", handle(c.Config))
req.Param("name", "config.sh")
test, err := req.Bytes()
_, err := req.Bytes()
if err != nil {
logs.Info("提交错误")
return err
} else {
logs.Info(string(test))
}
}
return nil
@ -557,15 +554,10 @@ func (c *Container) getSession() error {
req.Param("username", c.Username)
req.Param("password", c.Password)
rsp, err := req.Response()
logs.Info(rsp.Body)
if err != nil {
return err
}
//c.Token = rsp.Header.Get("Set-Cookie")
get := rsp.Header.Get("Set-Cookie")
all := strings.ReplaceAll(get, " Path=/; HttpOnly", "")
c.Token = all
logs.Info(c.Token)
c.Token = rsp.Header.Get("Set-Cookie")
if data, err := ioutil.ReadAll(rsp.Body); err != nil {
return err
} else {

View File

@ -34,5 +34,13 @@ https://thin-hill-428.notion.site/2-8Faker-QL-pannel-Faker-Repository-environmen
请使用官方一键安装 就解决此问题了
全面适配新版V4 需要旧版V4的同学自己修改下 container代码 553行
req := httplib.Post(c.Address + "/api/auth")
修改为
req := httplib.Post(c.Address + "/auth")
有问题自己提需求啊。。。有空就解决没空靠自己了各位铁子