From 01facc0c0c894a68bb659ab24efeabd4b0d34851 Mon Sep 17 00:00:00 2001 From: cg33 Date: Wed, 11 Sep 2019 17:21:15 +0800 Subject: [PATCH] Fix: update user bug --- plugins/admin/models/user.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/admin/models/user.go b/plugins/admin/models/user.go index fcef2cd09..0fbde8071 100644 --- a/plugins/admin/models/user.go +++ b/plugins/admin/models/user.go @@ -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