/// <summary> /// 传入ExpireSeconds,ActionName,ActionInfo(sceneId)。获取临时二维码,返回二维码图片文件的服务器地址。 /// </summary> /// <param name="msg"></param> /// <returns></returns> public static Stream GetTempQrCode(CreateQrCode msg) { msg.ActionName = EnumHelper.QrCodeType.QR_SCENE.ToString(); var result = HttpHelper.Post<QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(), "access_token=" + Token.GetAccessToken(msg)); var url = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + Token.GetAccessToken(msg); var stream = HttpHelper.GetStream(url,""); return stream; }
/// <summary> /// 传入ActionName,ActionInfo(scene_id对应QR_LIMIT_SCENE,scene_str对应QR_LIMIT_STR_SCENE) /// </summary> /// <param name="msg"></param> /// <returns></returns> public Stream GetEverQrCode(CreateQrCode msg) { var result = HttpHelper.Post<QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(), "access_token=" + Token.GetAccessToken(msg)); var url = ApiList.ShowQrcodeUrl + "?ticket=" + result.Ticket + "&access_token=" + Token.GetAccessToken(msg); var stream = HttpHelper.GetStream(url, ""); return stream; }
/// <summary> /// 创建二维码。 /// </summary> /// <param name="msg"></param> /// <returns></returns> public static QrResult CreateTempQrCode(CreateQrCode msg) { var result = HttpHelper.Post<QrResult>(ApiList.QrcodeCreateUrl, msg.ToString(), "access_token=" + Token.GetAccessToken(msg)); return result; }