Skip to content

Commit

Permalink
Fix: update user bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cg33 committed Sep 11, 2019
1 parent 97847da commit 01facc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/admin/models/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ func (t UserModel) AddPermission(permissionId string) {

func (t UserModel) MapToModel(m map[string]interface{}) UserModel {
t.Id = m["id"].(int64)
t.Name = m["name"].(string)
t.UserName = m["username"].(string)
t.Name, _ = m["name"].(string)
t.UserName, _ = m["username"].(string)
t.Password = m["password"].(string)
t.Avatar = m["avatar"].(string)
t.RememberToken = m["remember_token"].(string)
t.Avatar, _ = m["avatar"].(string)
t.RememberToken, _ = m["remember_token"].(string)
t.CreatedAt, _ = m["created_at"].(string)
t.UpdatedAt, _ = m["updated_at"].(string)
return t
Expand Down

0 comments on commit 01facc0

Please sign in to comment.