1
This commit is contained in:
@@ -280,7 +280,9 @@ func AddVendorOrgCode(ctx *jxcontext.Context, vendorOrgCode *model.VendorOrgCode
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(list) > 0 {
|
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
|
var userName string
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type TiktokShopController struct {
|
type TiktokShopController struct {
|
||||||
@@ -123,7 +122,6 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
|
|
||||||
globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false))
|
globals.SugarLogger.Debugf("result=====%s", utils.Format4Output(result, false))
|
||||||
|
|
||||||
result.ExpiresIn += time.Now().Unix()
|
|
||||||
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}
|
||||||
@@ -145,6 +143,7 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
AppSecret: "heihei", // web.AppConfig.DefaultString("tiktokShopAppSecret", "c397aa9f-3927-47c4-8cfe-4d84e02602e0")
|
AppSecret: "heihei", // 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