新增游戏图标,用户头像上传功能

This commit is contained in:
chy
2025-06-12 10:19:27 +08:00
parent f7cffcae21
commit cc8646156a
8 changed files with 117 additions and 5 deletions

View File

@ -170,6 +170,25 @@ func (c *weChatClient) GetToken() string {
return c.Token
}
func (c *weChatClient) GetUserUnionId(openid string) (unionId string, err error) {
return
func (c *weChatClient) GetUserUnionId(ctx context.Context, openid string) (unionId string, err error) {
// TODO 获取唯一UnionId
//result := struct {
// UnionId string `json:"unionid"`
//}{}
//
//resp, err := resty.New().R().
// SetQueryParams(g.MapStrStr{"access_token": c.accessToken}).SetQueryParam("openid", openid).
// SetResult(&result).
// Get("https://api.weixin.qq.com/cgi-bin/user/info")
//
//if err != nil {
// glog.Errorf(ctx, "发起 get ticket 请求出现异常: %+v", err)
// return "", ecode.Fail.Sub("发起 get ticket 请求出现异常")
//}
//if resp.StatusCode() != 200 {
// glog.Errorf(ctx, "获取微信 ticket 响应异常: %+v", resp.Status())
// return "", ecode.Fail.Sub("获取微信 ticket 失败")
//}
return openid, nil
}