1
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user