From 1dbd4426c3df7441134f343cef7ff53a82493386 Mon Sep 17 00:00:00 2001 From: 91c0e59d-6161-45ab-8aa4-2371574db28f <91c0e59d-6161-45ab-8aa4-2371574db28f@bankofchina.com> Date: Sat, 25 Jan 2025 10:45:52 +0800 Subject: [PATCH] fix qrcode use httpx. --- sdgb/sdgb.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sdgb/sdgb.py b/sdgb/sdgb.py index 087aeae..aa7a87f 100644 --- a/sdgb/sdgb.py +++ b/sdgb/sdgb.py @@ -29,7 +29,6 @@ class aes_pkcs7(object): def decrypt(self, content): cipher = AES.new(self.key, AES.MODE_CBC, self.iv) - #content = base64.b64decode(content) return cipher.decrypt(content) text = cipher.decrypt(content).decode('utf-8') return self.pkcs7unpadding(text) @@ -96,7 +95,10 @@ def qr_api(qr_code): "Host": "ai.sys-all.cn", "User-Agent": "WC_AIME_LIB" } - res = requests.post("http://ai.sys-allnet.cn/wc_aime/api/get_data", data=json.dumps(param, separators=(',', ':')), headers=headers) - # print(param) # debug打印param数据 + res = httpx.post( + "http://ai.sys-allnet.cn/wc_aime/api/get_data", + data = json.dumps(param, separators=(',', ':')), + headers = headers + ) assert res.status_code == 200, "网络错误" return json.loads(res.content) \ No newline at end of file