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"` // 公司