Skip to content

Commit

Permalink
fix sjkhsl#43 修复在没有用户的情况下会白屏的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
johlanse committed Aug 4, 2022
1 parent 0230177 commit 645d994
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion web/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 645d994

Please sign in to comment.