From 8a442be9394635be4f6e18c42bd7a9573a18bbd2 Mon Sep 17 00:00:00 2001 From: RogerWork Date: Fri, 29 Dec 2023 13:35:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=94=E5=9B=9E=E6=8C=87?= =?UTF-8?q?=E5=AE=9Ajson=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/views.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mock/views.py b/mock/views.py index f72fb09..7da3f48 100644 --- a/mock/views.py +++ b/mock/views.py @@ -41,7 +41,7 @@ def report_ticket(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.reportTicket is True: if customer_json := json_data.get('reportTicket'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'reportTicket') else: return mock_service.bypass(request) @@ -54,7 +54,7 @@ def report_film_schedule(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.reportFilmSchedule is True: if customer_json := json_data.get('reportFilmSchedule'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'reportFilmSchedule') else: return mock_service.bypass(request) @@ -67,7 +67,7 @@ def upload_screen_seat_info(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.uploadScreenSeatInfo is True: if customer_json := json_data.get('uploadScreenSeatInfo'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'uploadScreenSeatInfo') else: return mock_service.bypass(request) @@ -80,7 +80,7 @@ def download_film_info(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.downloadFilmInfo is True: if customer_json := json_data.get('downloadFilmInfo'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'downloadFilmInfo') else: return mock_service.bypass(request) @@ -92,7 +92,7 @@ def get_cinema_info(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.getCinemaInfo is True: if customer_json := json_data.get('getCinemaInfo'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'getCinemaInfo') else: return mock_service.bypass(request) @@ -104,7 +104,7 @@ def get_screen_info(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.getScreenInfo is True: if customer_json := json_data.get('getScreenInfo'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'getScreenInfo') else: return mock_service.bypass(request) @@ -118,7 +118,7 @@ def get_overtime_ticket_status(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.getOvertimeTicketStatus is True: if customer_json := json_data.get('getOvertimeTicketStatus'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'getOvertimeTicketStatus', request=request) else: return mock_service.bypass(request) @@ -131,7 +131,7 @@ def valid_error(request): mock_service_switch = ZZMockModel.objects.filter(ip=ip).first() if mock_service_switch.validError is True: if customer_json := json_data.get('validError'): - return customer_json + return JsonResponse(customer_json, json_dumps_params={'ensure_ascii': False}) return mock_service.mock(ip, 'validError') else: return mock_service.bypass(request)