diff --git a/controller/user.go b/controller/user.go index a897d41..dc18139 100644 --- a/controller/user.go +++ b/controller/user.go @@ -327,8 +327,8 @@ func modifyAccountDetail(c *gin.Context) { newUserInfo := new(model.UserDetail) newUserInfo.Id = targetUserId newUserInfo.Name = &modForm.Name - if &modForm.Name != nil { - abbr := tools.PinyinAbbr(*&modForm.Name) + if len(modForm.Name) > 0 { + abbr := tools.PinyinAbbr(modForm.Name) newUserInfo.Abbr = &abbr } newUserInfo.Region = modForm.Region