1
This commit is contained in:
@@ -281,7 +281,7 @@ func AddVendorOrgCode(ctx *jxcontext.Context, vendorOrgCode *model.VendorOrgCode
|
|||||||
}
|
}
|
||||||
if len(list) > 0 {
|
if len(list) > 0 {
|
||||||
vendorOrgCode.ID = list[0].ID
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,10 +86,8 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("codeToken============%s", utils.Format4Output(codeToken, false))
|
|
||||||
var codeMsg Code
|
var codeMsg Code
|
||||||
if err := json.Unmarshal([]byte(codeToken), &codeMsg); err != nil {
|
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.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
@@ -97,7 +95,6 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
|
|
||||||
var msg MsgDetail
|
var msg MsgDetail
|
||||||
if err := json.Unmarshal([]byte(codeMsg.Msg), &msg); err != nil {
|
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.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
@@ -114,7 +111,6 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("code ==================%s", utils.Format4Output(code, false))
|
|
||||||
if len(code) == 0 {
|
if len(code) == 0 {
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
@@ -128,8 +124,6 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false))
|
|
||||||
|
|
||||||
data, err := json.Marshal(result)
|
data, err := json.Marshal(result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
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{
|
param := &model.VendorOrgCode{
|
||||||
VendorID: model.VendorIDDD,
|
VendorID: model.VendorIDDD,
|
||||||
VendorOrgCode: utils.Int64ToStr(result.ShopId),
|
VendorOrgCode: utils.Int64ToStr(result.ShopId),
|
||||||
Comment: "抖音授权",
|
Comment: result.ShopName,
|
||||||
VendorType: "platform",
|
VendorType: "platform",
|
||||||
IsJxCat: 1,
|
IsJxCat: 1,
|
||||||
IsOpen: 1,
|
IsOpen: 1,
|
||||||
EmpowerURL: "https://fuwu.jinritemai.com/detail?from=open_partner_svcList&service_id=24070",
|
EmpowerURL: "https://fuwu.jinritemai.com/detail?from=open_partner_svcList&service_id=24070",
|
||||||
StoreBrandName: result.ShopName,
|
StoreBrandName: result.ShopName,
|
||||||
Token: string(data),
|
Token: string(data),
|
||||||
AppKey: "hhhh", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"),
|
AppKey: "", // web.AppConfig.DefaultString("tiktokShopAppId", "7136048270014416392"),
|
||||||
AppSecret: "heihei", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
AppSecret: "", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
||||||
}
|
}
|
||||||
if err := common.AddVendorOrgCode(nil, param); err != nil {
|
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.Data["json"] = tiktok_api.CallbackResponse{Code: tiktok_api.CallbackFailCode, Msg: tiktok_api.CallbackFail}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user