From 1f9cea6966852f936aae5bb4baeece546e676fe1 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 22:03:50 +0800 Subject: [PATCH] 1 --- business/jxstore/common/common.go | 2 +- controllers/tiktok_store.go | 13 +++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/business/jxstore/common/common.go b/business/jxstore/common/common.go index 94fc81b71..12b9136e7 100644 --- a/business/jxstore/common/common.go +++ b/business/jxstore/common/common.go @@ -281,7 +281,7 @@ func AddVendorOrgCode(ctx *jxcontext.Context, vendorOrgCode *model.VendorOrgCode } if len(list) > 0 { vendorOrgCode.ID = list[0].ID - _, err = dao.UpdateEntity(db, vendorOrgCode, "token", "updated_at", "app_key", "app_secret") + _, err = dao.UpdateEntity(db, vendorOrgCode, "token", "updated_at", "app_key", "app_secret", "comment", "vendor_org_code") return err } diff --git a/controllers/tiktok_store.go b/controllers/tiktok_store.go index 1064416c4..bdfa95fd0 100644 --- a/controllers/tiktok_store.go +++ b/controllers/tiktok_store.go @@ -86,10 +86,8 @@ func (c *TiktokShopController) TokenMsg() { c.ServeJSON() } - globals.SugarLogger.Debugf("codeToken============%s", utils.Format4Output(codeToken, false)) var codeMsg Code if err := json.Unmarshal([]byte(codeToken), &codeMsg); err != nil { - globals.SugarLogger.Debugf("err============%s", utils.Format4Output(codeToken, false)) c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} c.ServeJSON() return @@ -97,7 +95,6 @@ func (c *TiktokShopController) TokenMsg() { var msg MsgDetail if err := json.Unmarshal([]byte(codeMsg.Msg), &msg); err != nil { - globals.SugarLogger.Debugf("err============%s", utils.Format4Output(codeToken, false)) c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} c.ServeJSON() return @@ -114,7 +111,6 @@ func (c *TiktokShopController) TokenMsg() { } } - globals.SugarLogger.Debugf("code ==================%s", utils.Format4Output(code, false)) if len(code) == 0 { c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} c.ServeJSON() @@ -128,8 +124,6 @@ func (c *TiktokShopController) TokenMsg() { return } - globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false)) - data, err := json.Marshal(result) if err != nil { c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} @@ -140,18 +134,17 @@ func (c *TiktokShopController) TokenMsg() { param := &model.VendorOrgCode{ VendorID: model.VendorIDDD, VendorOrgCode: utils.Int64ToStr(result.ShopId), - Comment: "抖音授权", + Comment: result.ShopName, VendorType: "platform", IsJxCat: 1, IsOpen: 1, EmpowerURL: "https://fuwu.jinritemai.com/detail?from=open_partner_svcList&service_id=24070", StoreBrandName: result.ShopName, Token: string(data), - AppKey: "hhhh", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"), - AppSecret: "heihei", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0") + AppKey: "", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"), + AppSecret: "", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0") } if err := common.AddVendorOrgCode(nil, param); err != nil { - globals.SugarLogger.Debugf("AddVendorOrgCode=====err%s", err) c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} c.ServeJSON() return