Skip to content

Commit 65a149a

Browse files
committed
login: support qrcode png
Signed-off-by: xiao bo <[email protected]>
1 parent cf84e57 commit 65a149a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

channel/wechat/wechat_channel.py

+9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import threading
1111
import time
1212
import requests
13+
import qrcode
1314

1415
from bridge.context import *
1516
from bridge.reply import *
@@ -87,6 +88,14 @@ def qrCallback(uuid, status, qrcode):
8788

8889
url = f"https://login.weixin.qq.com/l/{uuid}"
8990

91+
img = qrcode.make(data=url)
92+
93+
if not os.path.exists('tmp'):
94+
os.makedirs('tmp')
95+
96+
with open('tmp/login.png', 'wb') as f:
97+
img.save(f)
98+
9099
qr_api1 = "https://api.isoyu.com/qr/?m=1&e=L&p=20&url={}".format(url)
91100
qr_api2 = "https://api.qrserver.com/v1/create-qr-code/?size=400×400&data={}".format(url)
92101
qr_api3 = "https://api.pwmqr.com/qrcode/create/?url={}".format(url)

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ Pillow
88
pre-commit
99
web.py
1010
linkai>=0.0.6.0
11+
qrcode

0 commit comments

Comments
 (0)