From a2e3bfab776ce0ede190cc6c87ac7fa6ded9686f Mon Sep 17 00:00:00 2001 From: zhaoxiaorong Date: Tue, 11 Feb 2025 14:22:14 +0800 Subject: [PATCH] fix --- infra/response.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infra/response.go b/infra/response.go index c23971b..8fd9eb2 100644 --- a/infra/response.go +++ b/infra/response.go @@ -15,12 +15,11 @@ type Reply struct { func (reply *Reply) Success(ctx *gin.Context, data any) { reply.Code = 200 + reply.Data = data if data == nil { reply.Data = "" } - ctx.JSON(200, reply) - return } func (reply *Reply) Error(ctx *gin.Context, err error) { reply.Code = 500 @@ -34,5 +33,4 @@ func (reply *Reply) Error(ctx *gin.Context, err error) { // Send error ctx.JSON(200, reply) - return }