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