From 8289a116499e5e7461a72913864d7a648e20a338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Mon, 24 Oct 2022 18:33:08 +0800 Subject: [PATCH] 1 --- controllers/tiktok_store.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/controllers/tiktok_store.go b/controllers/tiktok_store.go index 94dae5a8a..3d2ed1235 100644 --- a/controllers/tiktok_store.go +++ b/controllers/tiktok_store.go @@ -9,7 +9,6 @@ import ( "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" - "io/ioutil" "time" ) @@ -19,17 +18,15 @@ type TiktokShopController struct { // TokenMsg 抖音用户授权 func (c *TiktokShopController) TokenMsg() { - //codeValues := c.Ctx.Request.URL.Query() - //globals.SugarLogger.Debugf("codeValues=====%s", utils.Format4Output(codeValues, false)) - // - //codeList := codeValues.Get("code") - //globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false)) - data, err := ioutil.ReadAll(c.Ctx.Request.Body) - globals.SugarLogger.Debugf("data=====err%s", string(data)) - globals.SugarLogger.Debugf("err=====err%s", err) + codeValues := c.Ctx.Request.URL.Query() + globals.SugarLogger.Debugf("codeValues=====%s", utils.Format4Output(codeValues, false)) + + codeList := codeValues.Get("code") + globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false)) + globals.SugarLogger.Debugf("codeValues.Get(\"code\")%s", utils.Format4Output(codeValues.Get("Code"), false)) var code []string - if err := json.Unmarshal([]byte(string(data)), &code); err != nil { + if err := json.Unmarshal([]byte(string(codeList)), &code); err != nil { globals.SugarLogger.Debugf("codeList=====err%s", utils.Format4Output(err, false)) c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} c.ServeJSON()