Merge branch 'jdshop' of https://e.coding.net/rosydev/jx-callback into jdshop
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"git.rosy.net.cn/jx-callback/globals"
|
"git.rosy.net.cn/jx-callback/globals"
|
||||||
"git.rosy.net.cn/jx-callback/globals/api"
|
"git.rosy.net.cn/jx-callback/globals/api"
|
||||||
"github.com/astaxie/beego/server/web"
|
"github.com/astaxie/beego/server/web"
|
||||||
|
"io/ioutil"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -18,22 +19,23 @@ type TiktokShopController struct {
|
|||||||
|
|
||||||
// TokenMsg 抖音用户授权
|
// TokenMsg 抖音用户授权
|
||||||
func (c *TiktokShopController) TokenMsg() {
|
func (c *TiktokShopController) TokenMsg() {
|
||||||
codeValues := c.Ctx.Request.URL.Query()
|
//codeValues := c.Ctx.Request.URL.Query()
|
||||||
globals.SugarLogger.Debugf("codeValues=====%s", utils.Format4Output(codeValues, false))
|
//globals.SugarLogger.Debugf("codeValues=====%s", utils.Format4Output(codeValues, false))
|
||||||
|
//
|
||||||
codeList := codeValues.Get("code")
|
//codeList := codeValues.Get("code")
|
||||||
globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false))
|
//globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false))
|
||||||
|
data, err := ioutil.ReadAll(c.Ctx.Request.Body)
|
||||||
|
globals.SugarLogger.Debugf("data=====err%s", string(data))
|
||||||
|
globals.SugarLogger.Debugf("err=====err%s", err)
|
||||||
|
|
||||||
var code []string
|
var code []string
|
||||||
if err := json.Unmarshal([]byte(codeList), &code); err != nil {
|
if err := json.Unmarshal([]byte(string(data)), &code); err != nil {
|
||||||
globals.SugarLogger.Debugf("codeList=====err%s", utils.Format4Output(err, false))
|
globals.SugarLogger.Debugf("codeList=====err%s", utils.Format4Output(err, 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
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("codeList=====%s", utils.Format4Output(codeList, false))
|
|
||||||
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()
|
||||||
|
|||||||
Reference in New Issue
Block a user