From dcb4fcb23da4dacb4f9b894a3853192164f8339d Mon Sep 17 00:00:00 2001 From: zmister Date: Sun, 24 Oct 2021 23:32:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbase64=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=8E=A5=E5=8F=A3=E7=9A=84=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=AA=8C=E8=AF=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app_doc/util_upload_img.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app_doc/util_upload_img.py b/app_doc/util_upload_img.py index f27670134..499492d9d 100644 --- a/app_doc/util_upload_img.py +++ b/app_doc/util_upload_img.py @@ -228,8 +228,8 @@ def getImageExtensionName(temps): #image/png temps = temps[0].split('image/') if len(temps) == 2: - ## 如果文件传了扩展名,就取扩展名的文件类型 - if temps[-1] != '': + ## 如果文件传了扩展名,就取扩展名的文件类型,判断图片格式是否允许上传 + if temps[-1] in settings.ALLOWED_IMG: return "." + temps[-1] return ".png"