From 6d185497f5050a58f84b5c6ca6cb0fc4c94a1494 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Fri, 28 Jan 2022 23:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=87=BA=E9=94=99=E8=BE=93?= =?UTF-8?q?=E5=87=BAjson=E6=96=B0=E5=A2=9E=E5=A4=B4=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ExceptionHandle.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/ExceptionHandle.php b/app/ExceptionHandle.php index ffa1adf1e..cd44aafbb 100644 --- a/app/ExceptionHandle.php +++ b/app/ExceptionHandle.php @@ -89,6 +89,9 @@ class ExceptionHandle extends Handle $msg = '服务器错误'; } } + + // 结束并设置响应头 + header('Content-Type: application/json; charset=utf-8'); exit(json_encode(DataReturn($msg, $code))); } -- GitLab