|
@@ -190,6 +190,7 @@ class getAvatarView(TemplateView):
|
|
|
if filePath == '' or filePath == None:
|
|
|
return response.json(800)
|
|
|
fullPath = os.path.join(BASE_DIR, "static", filePath).replace('\\', '/')
|
|
|
+ defaultPath = os.path.join(BASE_DIR, "account/getAvatar/User/default.png").replace('\\', '/')
|
|
|
if os.path.isfile(fullPath):
|
|
|
try:
|
|
|
Imagedata = open(fullPath, 'rb').read()
|
|
@@ -197,7 +198,12 @@ class getAvatarView(TemplateView):
|
|
|
except Exception as e:
|
|
|
return response.json(906, repr(e))
|
|
|
else:
|
|
|
- return response.json(907)
|
|
|
+ try:
|
|
|
+ Imagedata = open(defaultPath, 'rb').read()
|
|
|
+ return HttpResponse(Imagedata, content_type="image/jpeg")
|
|
|
+ except Exception as e:
|
|
|
+ return response.json(906, repr(e))
|
|
|
+ # return response.json(907)
|
|
|
|
|
|
|
|
|
@csrf_exempt
|