Beispiel #1
0
        /// 获得Token
        /// <summary>
        /// 获得Token
        /// </summary>
        /// <param name="Code"></param>
        /// <returns></returns>
        protected OAuth_Token Get_token(string Code)
        {
            string      Str = GetJson("https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + SiteSettings.wxAppId + "&secret=" + SiteSettings.wxAppSecret + "&code=" + Code + "&grant_type=authorization_code");
            OAuth_Token Oauth_Token_Model = JsonHelper.ParseFromJson <OAuth_Token>(Str);

            return(Oauth_Token_Model);
        }
Beispiel #2
0
 public void GenerOauth(string code)
 {
     OAuth_Token Model = Get_token(code);
     OAuthUser   user  = Get_UserInfo(Model.access_token, Model.openid);
 }