From 8c5e56faf9cbedb49253540c0e3b8dd0f7f8f95d Mon Sep 17 00:00:00 2001 From: Chill Date: Tue, 31 Oct 2023 15:42:31 +0800 Subject: [PATCH] =?UTF-8?q?fix=20#I8AXL6=20[app=5Fai=5Fmedia]=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=9C=A8=E7=BD=91=E9=A1=B5=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=EF=BC=8C=E8=A6=81=E8=83=BD=E5=B0=86=E5=9B=BE=E8=BD=AC=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_common/models/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app_common/models/base.py b/app_common/models/base.py index 52774d44..e02b4ebf 100644 --- a/app_common/models/base.py +++ b/app_common/models/base.py @@ -149,7 +149,9 @@ def get_image_url2attachment(url): if not url: return None try: - response = requests.get(url, timeout=5) + if url.startswith('//'): + url = 'https:%s' % url + response = requests.get(url, timeout=30) except Exception as e: return None, None # 返回这个图片的base64编码