This commit is contained in:
gazebo
2019-12-09 09:48:58 +08:00
parent 52a4fd756f
commit a78bce0bbb

View File

@@ -21,13 +21,13 @@ type DjswController struct {
func (c *DjswController) handleMsg(isNeedDecode bool, handler func(*jdapi.API, interface{}) *jdapi.CallbackResponse) (callbackResponse *jdapi.CallbackResponse) {
if callbackMsg, mapData, response := jdapi.GetCallbackMsg2(getUsefulRequest(c.Ctx)); response == nil {
if jdAPI := jd.GetAPIByAppKey(callbackMsg.Token); jdAPI != nil {
if jdAPI := jd.GetAPIByAppKey(callbackMsg.AppKey); jdAPI != nil {
if response = jdAPI.CheckCallbackValidation2(mapData, callbackMsg.Sign); response == nil {
callbackResponse = handler(jdAPI, callbackMsg.Param)
}
} else {
callbackResponse = jdapi.Err2CallbackResponse(fmt.Errorf("没有匹配的token,非法请求"), "")
globals.SugarLogger.Warnf("handleMsg failed, can not find api for:%s", callbackMsg.Token)
globals.SugarLogger.Warnf("handleMsg failed, can not find api for:%s", callbackMsg.AppKey)
}
}
return callbackResponse