fix panic
This commit is contained in:
parent
59d9638bef
commit
6f16b754ce
|
@ -481,8 +481,9 @@ func ReplyJsonError(ctx *gin.Context, code int, msg string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func PrepareOp() gin.HandlerFunc {
|
func PrepareOp() gin.HandlerFunc {
|
||||||
return func(ctx *gin.Context) {
|
|
||||||
defer logger.Recover()
|
defer logger.Recover()
|
||||||
|
|
||||||
|
return func(ctx *gin.Context) {
|
||||||
//if ctx.ClientIP() != "127.0.0.1" {
|
//if ctx.ClientIP() != "127.0.0.1" {
|
||||||
// ReplyJsonError(ctx, http.StatusBadRequest, fmt.Sprintf("not localhost, ip: %s", ctx.ClientIP()))
|
// ReplyJsonError(ctx, http.StatusBadRequest, fmt.Sprintf("not localhost, ip: %s", ctx.ClientIP()))
|
||||||
// return
|
// return
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func OpCoinOrderList(ctx *gin.Context) {
|
func OpCoinOrderList(ctx *gin.Context) {
|
||||||
defer logger.Recover()
|
//defer logger.Recover()
|
||||||
req := ctx.MustGet("client_req").(*vasproto.OpCoinOrderListReq)
|
req := ctx.MustGet("client_req").(*vasproto.OpCoinOrderListReq)
|
||||||
if req.Limit <= 0 {
|
if req.Limit <= 0 {
|
||||||
req.Limit = 1000
|
req.Limit = 1000
|
||||||
|
@ -28,7 +28,7 @@ func OpCoinOrderList(ctx *gin.Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func OpOrderList(ctx *gin.Context) {
|
func OpOrderList(ctx *gin.Context) {
|
||||||
defer logger.Recover()
|
//defer logger.Recover()
|
||||||
req := ctx.MustGet("client_req").(*vasproto.OpOrderListReq)
|
req := ctx.MustGet("client_req").(*vasproto.OpOrderListReq)
|
||||||
if req.Limit <= 0 {
|
if req.Limit <= 0 {
|
||||||
req.Limit = 1000
|
req.Limit = 1000
|
||||||
|
|
Loading…
Reference in New Issue