瀏覽代碼

新增参数获取

longyu 2 年之前
父節點
當前提交
2cd44bcfb6
共有 1 個文件被更改,包括 11 次插入0 次删除
  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)
 }