Commit 3876c2ad authored by wangp's avatar wangp

签名验证

parent cac8c9ca
...@@ -46,17 +46,19 @@ func (l *PayController) WxNotice(c *gin.Context) { ...@@ -46,17 +46,19 @@ func (l *PayController) WxNotice(c *gin.Context) {
base.ResponseWxNotice(c, response) base.ResponseWxNotice(c, response)
return return
} }
//fmt.Println("验证签名成功...")
//fmt.Println("验证签名成功...未完...")
//response := new(base.ResponseDataWxNotice) //response := new(base.ResponseDataWxNotice)
//response.Code = "SUCCESS" //response.Code = "SUCCESS"
//response.Message = "执行成功" //response.Message = "执行成功"
//base.ResponseWxNotice(c, response) //base.ResponseWxNotice(c, response)
//return //return
fmt.Println("验证签名成功...") fmt.Println("验证签名成功")
ph := new(models.WxNoticeInput) ph := new(models.WxNoticeInput)
err = c.ShouldBindJSON(ph) //err := c.ShouldBindJSON(ph)
err = c.ShouldBindBodyWith(&ph, binding.JSON)
if err != nil { if err != nil {
response := new(base.ResponseDataWxNotice) response := new(base.ResponseDataWxNotice)
response.Code = "FAIL" response.Code = "FAIL"
...@@ -128,7 +130,8 @@ func VerifySignCert(c *gin.Context) error { ...@@ -128,7 +130,8 @@ func VerifySignCert(c *gin.Context) error {
//reqBody := string(b) //获取response body //reqBody := string(b) //获取response body
var body interface{} var body interface{}
if err = c.ShouldBindBodyWith(&body, binding.JSON); err != nil { err = c.ShouldBindBodyWith(&body, binding.JSON)
if err != nil {
//log.Default().Error("should bind body error", zap.Error(err)) //log.Default().Error("should bind body error", zap.Error(err))
fmt.Println("should bind body error: " + err.Error()) fmt.Println("should bind body error: " + err.Error())
return err return err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment