1
This commit is contained in:
@@ -56,6 +56,17 @@ func PKCS5UnPadding(origData []byte) []byte {
|
|||||||
return origData[:(length - unfilledNum)]
|
return origData[:(length - unfilledNum)]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Code struct {
|
||||||
|
MsgType int64 `json:"msg_type"`
|
||||||
|
msg struct {
|
||||||
|
ActionType int64 `json:"action_type"`
|
||||||
|
AppId int64 `json:"app_id"`
|
||||||
|
ShopId int64 `json:"shop_id"`
|
||||||
|
Code string `json:"code"`
|
||||||
|
CodeGenerateTime string `json:"code_generate_time"`
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (c *TiktokShopController) TokenMsg() {
|
func (c *TiktokShopController) TokenMsg() {
|
||||||
req := c.Ctx.Request
|
req := c.Ctx.Request
|
||||||
var code []string
|
var code []string
|
||||||
@@ -77,11 +88,16 @@ func (c *TiktokShopController) TokenMsg() {
|
|||||||
case http.MethodGet:
|
case http.MethodGet:
|
||||||
codeValues := req.URL.Query()
|
codeValues := req.URL.Query()
|
||||||
codeList := codeValues.Get("code")
|
codeList := codeValues.Get("code")
|
||||||
if err := json.Unmarshal([]byte(string(codeList)), &code); err != nil {
|
|
||||||
|
codeResult := make([]Code, 0, 0)
|
||||||
|
if err := json.Unmarshal([]byte(string(codeList)), &codeResult); 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}
|
||||||
c.ServeJSON()
|
c.ServeJSON()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
for _, v := range codeResult {
|
||||||
|
code = append(code, v.msg.Code)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globals.SugarLogger.Debugf("code ==================%s", utils.Format4Output(code, false))
|
globals.SugarLogger.Debugf("code ==================%s", utils.Format4Output(code, false))
|
||||||
|
|||||||
Reference in New Issue
Block a user