From beb31523fcab4db87e8d9fe5d7a2d576fba26b73 Mon Sep 17 00:00:00 2001 From: xuxiaofei Date: Sat, 31 Oct 2020 10:33:33 +0800 Subject: [PATCH] fix: add decode ignore --- vislib/views/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vislib/views/views.py b/vislib/views/views.py index 25e0f1d..5cb7ec0 100644 --- a/vislib/views/views.py +++ b/vislib/views/views.py @@ -50,7 +50,7 @@ def execSql(request): column = key if isinstance(row[key], bytes): print(row[key], key) - json_data[index][column] = row[key].decode('UTF-8') + json_data[index][column] = row[key].decode('UTF-8', 'ignore') else: json_data[index][column] = row[key] response = { @@ -62,7 +62,7 @@ def execSql(request): print(e) response = { 'code': 10000, - 'message': 'fail', - 'data': str(e) + 'message': str(e), + 'data': {} } return JsonResponse(response)