更新
This commit is contained in:
parent
e164ced733
commit
fb2bcd87eb
|
@ -39,15 +39,20 @@ func (l *UserGetProfileLogic) UserGetProfile(req *types.QueryProfileRequest, use
|
|||
return resp.SetStatusWithMessage(basic.CodeApiErr, err.Error())
|
||||
}
|
||||
|
||||
if userinfo.UserId != 0 {
|
||||
user, err := l.svcCtx.AllModels.FsUser.FindUserById(context.TODO(), userinfo.UserId)
|
||||
if err != nil {
|
||||
logx.Error(err) // 日志记录错误
|
||||
return resp.SetStatus(basic.CodeDbSqlErr, err) // 返回数据库创建错误
|
||||
}
|
||||
|
||||
if bmap, ok := profileBase["base"].(map[string]any); ok {
|
||||
bmap["email"] = *user.Email
|
||||
}
|
||||
} else {
|
||||
if bmap, ok := profileBase["base"].(map[string]any); ok {
|
||||
bmap["email"] = ""
|
||||
}
|
||||
}
|
||||
|
||||
return resp.SetStatus(basic.CodeOK, profileBase)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user