优化用户TokenAPI图片上传问题

This commit is contained in:
yangjian 2021-08-17 07:51:47 +08:00
parent f0d0b08d8d
commit 9bbb74e6f4

View File

@ -293,9 +293,8 @@ def upload_img(request):
# {"success": 1, "url": "图片地址"}
##################
token = request.GET.get('token', '')
#base64_img = request.POST.get('data','')
base64_img = request.POST.get('data','')
try:
base64_img = json.loads(request.body.decode("ascii"))['data']
# 验证Token
token = UserToken.objects.get(token=token)
# 上传图片