mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-28 23:32:48 +00:00
fix: 修复再次修改logo报错的缺陷
--bug=1044392 --user=王孝刚 【系统管理】外观设置,修改网站logo后再次修改报错 https://www.tapd.cn/57709429/s/1553208
This commit is contained in:
parent
0143aef38d
commit
146121c960
|
|
@ -39,4 +39,6 @@ class ImageSerializer(serializers.Serializer):
|
|||
image = QuerySet(Image).filter(id=image_id).first()
|
||||
if image is None:
|
||||
raise NotFound404(404, "不存在的图片")
|
||||
if image.image_name.endswith('.svg'):
|
||||
return HttpResponse(image.image, status=200, headers={'Content-Type': 'image/svg+xml'})
|
||||
return HttpResponse(image.image, status=200, headers={'Content-Type': 'image/png'})
|
||||
|
|
|
|||
Loading…
Reference in New Issue