From 47aefb5e001fb59f63cc9e0a8c6bee78bd35d576 Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Fri, 24 Nov 2023 10:25:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=BA=E5=88=B6=E7=BB=99?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/info/internal/logic/usergetprofilelogic.go | 8 ++++++++ server_api/info.api | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/info/internal/logic/usergetprofilelogic.go b/server/info/internal/logic/usergetprofilelogic.go index b94f5caa..15f840ac 100644 --- a/server/info/internal/logic/usergetprofilelogic.go +++ b/server/info/internal/logic/usergetprofilelogic.go @@ -39,6 +39,14 @@ func (l *UserGetProfileLogic) UserGetProfile(req *types.QueryProfileRequest, use return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error()) } + user, err := l.svcCtx.AllModels.FsUser.FindUserById(context.TODO(), userinfo.UserId) + if err != nil { + logx.Error(err) // 日志记录错误 + return resp.SetStatus(basic.CodeDbSqlErr, err) // 返回数据库创建错误 + } + + profileBase["email"] = *user.Email + return resp.SetStatus(basic.CodeOK, profileBase) } diff --git a/server_api/info.api b/server_api/info.api index 8e7b2b33..b1e72d37 100644 --- a/server_api/info.api +++ b/server_api/info.api @@ -112,7 +112,7 @@ type ( FirstName *string `json:"first_name,optional"` // 首名 LastName *string `json:"last_name,optional"` // 后名 // UserName *string `json:"user_name,optional"` // 用户名 - Email *string `json:"email,optional,omitempty"` // email + Email *string `json:"email,optional"` // email Mobile *string `json:"mobile,optional"` // 电话 Resetaurant *string `json:"resetaurant,optional"` // 不知道干什么 Company *string `json:"company,optional"` // 公司