Ejemplo n.º 1
0
        static string GetToken()
        {
            string str = LeoHttpHelper.Get($"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={AppID}&secret={AppSercet}");
            var    obj = str.ToDynamic();

            return(obj.access_token);
        }
Ejemplo n.º 2
0
        public static MiniLoginResult Login(string code)
        {
            string          url         = $"https://api.weixin.qq.com/sns/jscode2session?appid={AppID}&secret={AppSercet}&js_code={code}&grant_type=authorization_code";
            string          result      = LeoHttpHelper.Get(url);
            MiniLoginResult loginResult = JsonConvert.DeserializeObject <MiniLoginResult>(result);

            return(loginResult);
        }