收藏
回答

PC端微信扫码登录注册如何获取手机号?

 using (HttpClient client = new HttpClient())
        {
            string url = $"https://api.weixin.qq.com/cgi-bin/user/info?access_token={accessToken}&openid={unionId}";
            HttpResponseMessage response = await client.GetAsync(url);
            if (response.IsSuccessStatusCode)
            {
                string jsonResponse = await response.Content.ReadAsStringAsync();
                JObject json = JObject.Parse(jsonResponse);
                return json["phone_number"]?.ToString();
            }


回答关注问题邀请回答
收藏
登录 后发表内容