Browse Source

fix: add decode ignore

master
xuxiaofei 4 years ago
parent
commit
beb31523fc
  1. 6
      vislib/views/views.py

6
vislib/views/views.py

@ -50,7 +50,7 @@ def execSql(request):
column = key column = key
if isinstance(row[key], bytes): if isinstance(row[key], bytes):
print(row[key], key) print(row[key], key)
json_data[index][column] = row[key].decode('UTF-8') json_data[index][column] = row[key].decode('UTF-8', 'ignore')
else: else:
json_data[index][column] = row[key] json_data[index][column] = row[key]
response = { response = {
@ -62,7 +62,7 @@ def execSql(request):
print(e) print(e)
response = { response = {
'code': 10000, 'code': 10000,
'message': 'fail', 'message': str(e),
'data': str(e) 'data': {}
} }
return JsonResponse(response) return JsonResponse(response)

Loading…
Cancel
Save