This commit is contained in:
XXAY
2021-10-08 17:55:53 +08:00
parent 3a0b85c799
commit 920581c4ae
4 changed files with 17 additions and 541 deletions
+5 -6
View File
@@ -117,9 +117,8 @@ def chart_run(request, get_chart_sort):
# chart 展示图片的路径
# out_path 输出文件的路径
print(data)
eval(f'charts.{chart_name}')(file_path[0], f"{chart_out_path}_{k}.png", out_path, **data)
return JsonResponse({"img": f"/static/img_eg/show_chart/{file_id}_{k}.png"})
try:
eval(f'charts.{chart_name}')(file_path[0], f"{chart_out_path}_{k}.png", out_path, **data)
except:
return JsonResponse({"ba": "File format error or parameter error"})
return JsonResponse({"img": f"/static/img_eg/show_chart/{file_id}_{k}.png", "ba": "0"})