Commit f4c8ca61 by 杨树贤

fix

parent 8f4daa2d
...@@ -130,19 +130,35 @@ class SupplierShareApplyApiController extends Controller ...@@ -130,19 +130,35 @@ class SupplierShareApplyApiController extends Controller
$userId = $request->user->userId; $userId = $request->user->userId;
$list = $applyService->getAuditSupplierShareApplyList($userId); $list = $applyService->getAuditSupplierShareApplyList($userId);
// 设置响应头,避免chunked encoding // 清除之前的输出缓冲
$response = json_encode([ if (ob_get_level()) {
ob_end_clean();
}
// 开启新的输出缓冲
ob_start();
$response = [
'err_code' => 0, 'err_code' => 0,
'code' => 0, 'code' => 0,
'err_msg' => 'ok', 'err_msg' => 'ok',
'data' => $list['data'], 'data' => $list['data'],
'count' => $list['total'], 'count' => $list['total'],
'total' => $list['total'], 'total' => $list['total'],
]); ];
echo json_encode($response);
// 获取缓冲内容长度
$content = ob_get_contents();
$length = strlen($content);
// 清除缓冲并设置响应头
ob_end_clean();
header('Content-Type: application/json'); header('Content-Type: application/json; charset=utf-8');
header('Content-Length: ' . strlen($response)); header('Content-Length: ' . $length);
echo $response; echo $content;
exit(); exit();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment