Esempio n. 1
0
        public async Task <WxUser> GetSnsApiUserInfo(string code)
        {
            var token = await AccessTokenFactory.GetTokenAsync(code);

            if (token == null)
            {
                return(null);
            }

            string url = $"{WxConstants.SNSAPI_USERINFO_URL}?access_token={token.AccessToken}&openid={token.OpenId}&lang=zh_CN";

            return(await WxClient.GetAsync <WxUser>(url));
        }