From 4ba4610190708c1a43bce5d130dc4a64285a07d7 Mon Sep 17 00:00:00 2001 From: yangjian Date: Sun, 21 Mar 2021 17:28:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E6=88=90=E5=8A=9F=E4=BD=86=E6=8F=90=E7=A4=BA=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= 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 abe09b9..d3d3aae 100644 --- a/app_doc/util_upload_img.py +++ b/app_doc/util_upload_img.py @@ -1,5 +1,5 @@ # coding:utf-8 -from django.http import HttpResponse +from django.http import HttpResponse,JsonResponse from django.conf import settings from django.views.decorators.csrf import csrf_exempt from django.contrib.auth.decorators import login_required # 登录需求装饰器 @@ -167,7 +167,7 @@ def upload_img(request): result = url_img_upload(url_img,dir_name,request.user) else: result = {"success": 0, "message": _("上传出错")} - return HttpResponse(json.dumps(result), content_type="application/json") + return JsonResponse(result) # 目录创建