Exemplo n.º 1
0
        /// <summary>
        /// 创建二维码。
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static QrCodeResult CreateTempQrCode(CreateQrCode msg)
        {
            var result = HttpHelper.Post <QrCodeResult>(new HttpParam()
            {
                Url       = ApiList.QrcodeCreateUrl,
                PostParam = msg.ToJsonString(),
                GetParam  = "access_token=" + TokenHelper.GetAccessToken()
            });

            return(result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 传入ActionName,ActionInfo(scene_id对应QR_LIMIT_SCENE,scene_str对应QR_LIMIT_STR_SCENE)
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static Stream GetEverQrCode(CreateQrCode msg)
        {
            msg.ActionName = EnumHelper.QrCodeType.QR_LIMIT_STR_SCENE.ToString();
            var result = HttpHelper.Post <QrCodeResult>(
                new HttpParam()
            {
                Url =
                    ApiList.QrcodeCreateUrl,
                PostParam = msg.ToJsonString(),
                GetParam  = "access_token=" + TokenHelper.GetAccessToken()
            });
            var url    = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + TokenHelper.GetAccessToken();
            var stream = HttpHelper.GetStream(url);

            return(stream);
        }