Ver Fonte

新增参数获取

longyu há 2 anos atrás
pai
commit
2cd44bcfb6
1 ficheiros alterados com 11 adições e 0 exclusões
  1. 11 0
      controllers/wechat.go

+ 11 - 0
controllers/wechat.go

@@ -374,5 +374,16 @@ func (this *WechatCommonController) Notify() {
 	fmt.Println("signature:", signature)
 	fmt.Println("timestamp:", timestamp)
 	fmt.Println("nonce:", nonce)
+	body := this.Ctx.Input.RequestBody
+	paramsMap := this.Ctx.Input.Params()
+	fmt.Println("paramsMap")
+	fmt.Println(paramsMap)
+	paramsJson, err := json.Marshal(paramsMap)
+	if err != nil {
+		fmt.Println("json.Marshal Err:" + err.Error())
+	}
+
+	utils.FileLog.Info("notify result:" + string(body))
+	utils.FileLog.Info("notify paramsJson result:" + string(paramsJson))
 	this.Ctx.WriteString(echostr)
 }