diff --git a/app/http/controllers/api.go b/app/http/controllers/api.go index bf0f1d7..085c8b1 100644 --- a/app/http/controllers/api.go +++ b/app/http/controllers/api.go @@ -19,8 +19,12 @@ func ApiRes(c *gin.Context, data interface{}, code int, msg ...string) { var logId int64 var responseData interface{} var message string + var appCheckInfo *services.AppCheck originData := "{}" - appCheckInfo := GetAppCheckInfo(c).(*services.AppCheck) + appInfo := GetAppCheckInfo(c) + if appInfo != nil { + appCheckInfo = appInfo.(*services.AppCheck) + } // 空数据 if utils.IsNil(data) { data = struct{}{} diff --git a/app/http/controllers/front/api.go b/app/http/controllers/front/api.go index 4ffffc9..67a0b49 100644 --- a/app/http/controllers/front/api.go +++ b/app/http/controllers/front/api.go @@ -71,7 +71,7 @@ func QueryOrder(c *gin.Context) { cond := builder.NewCond() cond = cond.And(builder.Eq{"out_trade_no": order.OutTradeNo}, builder.Eq{"app_id": order.AppId}) _, code := services.OrderFindOne(&order, cond) - if code != errorcode.OrdersExist { + if code != errorcode.Success { controllers.ApiRes(c, nil, code) return } diff --git a/app/http/requestmapping/front.go b/app/http/requestmapping/front.go index 1d87d3d..366d8a4 100644 --- a/app/http/requestmapping/front.go +++ b/app/http/requestmapping/front.go @@ -12,5 +12,6 @@ var FrontRequestMap = map[string]func() (validForm interface{}, isSaveLog bool){ } var FrontRequestMapBeforeDecrypt = map[string]func() interface{}{ - common.FRONT_V1 + "/pay/url": func() interface{} { return new(front.RequestBody) }, + common.FRONT_V1 + "/pay/url": func() interface{} { return new(front.RequestBody) }, + common.FRONT_V1 + "/pay/query": func() interface{} { return new(front.RequestBody) }, }