From 457122aae70c130e3e71cbd576344f3b4d6e875c Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Sat, 25 Sep 2021 10:37:03 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=B0=83=E8=AF=95=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/login.go | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/controllers/login.go b/controllers/login.go index 83885b6..384a17e 100644 --- a/controllers/login.go +++ b/controllers/login.go @@ -44,25 +44,25 @@ type Result struct { var JdCookieRunners sync.Map var jdua = models.GetUserAgent -//func (c *LoginController) GetQrcode1() { -// rsp, err := httplib.Get("https://api.kukuqaq.com/jd/qrcode").Response() -// if err != nil { -// logs.Info(err) -// } -// body, err1 := ioutil.ReadAll(rsp.Body) -// if err1 == nil { -// fmt.Println(string(body)) -// } -// s := &models.QQuery{} -// if len(body) > 0 { -// json.Unmarshal(body, &s) -// } -// jsonByte, _ := json.Marshal(s) -// jsonStr := string(jsonByte) -// fmt.Printf("%v", jsonStr) -// c.Ctx.WriteString(`{"url":"` + "url" + `","img":"` + base64.StdEncoding.EncodeToString(data) + `"}`) //"data:image/png;base64," + -// -//} +func (c *LoginController) GetQrcode1() { + rsp, err := httplib.Get("https://api.kukuqaq.com/jd/qrcode").Response() + if err != nil { + logs.Info(err) + } + body, err1 := ioutil.ReadAll(rsp.Body) + if err1 == nil { + fmt.Println(string(body)) + } + s := &models.QQuery{} + if len(body) > 0 { + json.Unmarshal(body, &s) + } + jsonByte, _ := json.Marshal(s) + jsonStr := string(jsonByte) + fmt.Printf("%v", jsonStr) + //c.Ctx.WriteString(`{"url":"` + "url" + `","img":"` + base64.StdEncoding.EncodeToString(data) + `"}`) //"data:image/png;base64," + + +} func (c *LoginController) GetQrcode() { if v := c.GetSession("jd_token"); v != nil {