This commit is contained in:
2025-09-05 23:35:47 +08:00
parent 16fb22479f
commit e26a9e7735
4 changed files with 42 additions and 25 deletions
@@ -111,18 +111,19 @@ func (w *MiniUserApi) GetUserInfo(c *gin.Context) {
// 构造响应数据
resp := wechatResponse.MiniUserInfoResponse{
ID: user.ID,
OpenID: user.OpenID,
UnionID: user.UnionID,
NickName: user.Nickname,
Avatar: user.AvatarURL,
Phone: user.Phone,
Gender: user.Gender,
City: user.City,
Province: user.Province,
Country: user.Country,
CreateTime: user.CreatedAt.Format("2006-01-02 15:04:05"),
UpdateTime: user.UpdatedAt.Format("2006-01-02 15:04:05"),
ID: user.ID,
OpenID: user.OpenID,
UnionID: user.UnionID,
NickName: user.Nickname,
Avatar: user.AvatarURL,
Phone: user.Phone,
Gender: user.Gender,
City: user.City,
Province: user.Province,
Country: user.Country,
CreateTime: user.CreatedAt.Format("2006-01-02 15:04:05"),
UpdateTime: user.UpdatedAt.Format("2006-01-02 15:04:05"),
NeedPhoneAuth: user.Phone == nil || *user.Phone == "", // 如果没有手机号则需要授权
}
c.JSON(200, wechatResponse.SuccessResponseWithMsg(resp, "获取成功"))