Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
修复base64图片上传接口的图片格式验证问题
  • Loading branch information
zmister committed Oct 24, 2021
1 parent 46ef532 commit dcb4fcb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app_doc/util_upload_img.py
Expand Up @@ -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"

Expand Down

0 comments on commit dcb4fcb

Please sign in to comment.