From 2218e27838d94cc0c47f4086a0c3141049c53637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E6=B6=9B?= Date: Sun, 18 Sep 2022 11:42:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(user):=E4=BF=AE=E6=AD=A3=E5=AF=B9=E4=BA=8E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0=E6=98=AF=E5=90=A6=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E5=88=A4=E6=96=AD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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