diff --git a/src/models/user.go b/src/models/user.go index 3d9cdb89..f485eb6a 100644 --- a/src/models/user.go +++ b/src/models/user.go @@ -29,7 +29,7 @@ const ( type User struct { Id int64 `json:"id"` - UUID string `json:"-" xorm:"'uuid'"` + UUID string `json:"uuid" xorm:"'uuid'"` Username string `json:"username"` Password string `json:"-"` Dispname string `json:"dispname"` diff --git a/src/modules/rdb/http/router_role.go b/src/modules/rdb/http/router_role.go index f41b5e9b..f3c5432d 100644 --- a/src/modules/rdb/http/router_role.go +++ b/src/modules/rdb/http/router_role.go @@ -102,6 +102,10 @@ func roleGlobalUsersGet(c *gin.Context) { list, err := models.UserSearchListInIds(ids, query, limit, offset(c, limit)) dangerous(err) + for i := 0; i < len(list); i++ { + list[i].UUID = "" + } + renderData(c, gin.H{ "list": list, "total": total, diff --git a/src/modules/rdb/http/router_user.go b/src/modules/rdb/http/router_user.go index 876bcc14..08fe70e7 100644 --- a/src/modules/rdb/http/router_user.go +++ b/src/modules/rdb/http/router_user.go @@ -23,6 +23,10 @@ func userListGet(c *gin.Context) { list, err := models.UserGets(ids, query, limit, offset(c, limit)) dangerous(err) + for i := 0; i < len(list); i++ { + list[i].UUID = "" + } + renderData(c, gin.H{ "list": list, "total": total, @@ -75,7 +79,9 @@ func userAddPost(c *gin.Context) { } func userProfileGet(c *gin.Context) { - renderData(c, User(urlParamInt64(c, "id")), nil) + user := User(urlParamInt64(c, "id")) + user.UUID = "" + renderData(c, user,nil) } func userProfilePut(c *gin.Context) {