diff --git a/business/jxstore/common/common.go b/business/jxstore/common/common.go index e11d5cebc..94fc81b71 100644 --- a/business/jxstore/common/common.go +++ b/business/jxstore/common/common.go @@ -280,7 +280,9 @@ func AddVendorOrgCode(ctx *jxcontext.Context, vendorOrgCode *model.VendorOrgCode return err } if len(list) > 0 { - return fmt.Errorf("库里有这个账号了,[%v]", vendorOrgCode.VendorOrgCode) + vendorOrgCode.ID = list[0].ID + _, err = dao.UpdateEntity(db, vendorOrgCode, "token", "updated_at", "app_key", "app_secret") + return err } var userName string diff --git a/controllers/tiktok_store.go b/controllers/tiktok_store.go index 3662242bd..c26b711d5 100644 --- a/controllers/tiktok_store.go +++ b/controllers/tiktok_store.go @@ -16,7 +16,6 @@ import ( "io/ioutil" "net/http" "strings" - "time" ) type TiktokShopController struct { @@ -123,7 +122,6 @@ func (c *TiktokShopController) TokenMsg() { globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false)) - result.ExpiresIn += time.Now().Unix() data, err := json.Marshal(result) if err != nil { c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail} @@ -145,6 +143,7 @@ func (c *TiktokShopController) TokenMsg() { AppSecret: "heihei", // 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