code refactor
This commit is contained in:
parent
b448dad860
commit
a4026e8c25
|
@ -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"`
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue