From 645d994e2e2ea20e5d05cfe5ca1ddd390c9d268a Mon Sep 17 00:00:00 2001 From: johlanse Date: Thu, 4 Aug 2022 13:59:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#43=20=E4=BF=AE=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=94=A8=E6=88=B7=E7=9A=84=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E4=BC=9A=E7=99=BD=E5=B1=8F=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/controller.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/controller.go b/web/controller.go index 208dead..d2ae66c 100644 --- a/web/controller.go +++ b/web/controller.go @@ -155,8 +155,16 @@ func getUsers() gin.HandlerFunc { return } if users == nil { - users = []*model.User{} + ctx.JSON(200, Resp{ + Code: 200, + Message: "查询成功", + Data: []interface{}{}, + Success: true, + Error: "", + }) + return } + var datas []map[string]interface{} for _, user := range users { var isStudy = false