From 03f55871d809c62cf5d80b29703feaaabb73b6ee Mon Sep 17 00:00:00 2001 From: wsb1224 Date: Sat, 4 Jul 2026 07:51:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BF=AB=E9=80=92100=20OCR=E9=9D=A2?= =?UTF-8?q?=E5=8D=95=E8=AF=86=E5=88=AB=E6=8E=A5=E5=8F=A3=E6=94=B9=E7=94=A8?= =?UTF-8?q?=20HTTPS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit HTTP 请求返回 404 HTML 页面,改为 HTTPS 解决。 Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/logistics_service.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backend/app/services/logistics_service.py b/backend/app/services/logistics_service.py index 6fc605d..3d0230d 100644 --- a/backend/app/services/logistics_service.py +++ b/backend/app/services/logistics_service.py @@ -866,13 +866,14 @@ class LogisticsService: }).encode("utf-8") req = request.Request( - url="http://api.kuaidi100.com/elec/detocr", + url="https://api.kuaidi100.com/elec/detocr", data=form_data, headers={"Content-Type": "application/x-www-form-urlencoded"}, method="POST", ) with request.urlopen(req, timeout=30) as resp: - result = json.loads(resp.read().decode("utf-8") or "{}") + raw = resp.read().decode("utf-8") or "{}" + result = json.loads(raw) raw_result = result # 5. 解析返回: data.waybill 为运单号, data.barcode 为条码