Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

无法获取二维码图像时的重连处理 #34

Open
reverland opened this issue Feb 6, 2016 · 3 comments
Open

无法获取二维码图像时的重连处理 #34

reverland opened this issue Feb 6, 2016 · 3 comments

Comments

@reverland
Copy link
Contributor

参加 #33 有时候uuid获取了,图像始终加载不出来。

之前考虑到网络问题,图像文件时stream到显示设备。但有的显示设备并不具有显示部分文件的能力。

结果程序很早就给出请扫描二维码图片的提示,但图像始终无法加载。

对策:监听流事件给出更好的提示信息,设置超时重连(包括uuid)

@reverland reverland added this to the v0.2 milestone Feb 6, 2016
@lyyyuna
Copy link

lyyyuna commented Feb 24, 2016

看了下 Urinx/WeixinBot 的代码,二维码似乎只是包含 url+uuid 的信息,不需要去下载图片,自己生成即可。

def genQRCode(self):
    if sys.platform.startswith('win'):
        self._showQRCodeImg()  # win 平台去 download 了图片
    else:
        self._str2qr('https://login.weixin.qq.com/l/' + self.uuid)

def _str2qr(self, str):
    qr = qrcode.QRCode()
    qr.border = 1
    qr.add_data(str)
    mat = qr.get_matrix()
    self._printQR(mat)

@reverland
Copy link
Contributor Author

@lyyyuna 我在linux分支试了,但还是喜欢imagick2233

@reverland
Copy link
Contributor Author

6954cd5

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants