1
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"crypto/md5"
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
beego "github.com/astaxie/beego/server/web"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -17,6 +18,9 @@ func GetCmd(request *http.Request) (cmd string) {
|
||||
// EventSignChange 回调消息防伪标签校验
|
||||
func (a *API) EventSignChange(c *http.Request) (*CallbackResponse, []byte) {
|
||||
body, _ := ioutil.ReadAll(c.Body)
|
||||
if beego.BConfig.RunMode == "jxgy" {
|
||||
return CallbackResponseErr(true), body
|
||||
}
|
||||
signParam := a.appKey + string(body) + a.appSecret
|
||||
sign := fmt.Sprintf("%X", md5.Sum([]byte(signParam)))
|
||||
return CallbackResponseErr(sign != c.Header.Get("event-sign")), body
|
||||
|
||||
Reference in New Issue
Block a user