Commit f4c8ca61 by 杨树贤

fix

parent 8f4daa2d
......@@ -130,19 +130,35 @@ class SupplierShareApplyApiController extends Controller
$userId = $request->user->userId;
$list = $applyService->getAuditSupplierShareApplyList($userId);
// 设置响应头,避免chunked encoding
$response = json_encode([
// 清除之前的输出缓冲
if (ob_get_level()) {
ob_end_clean();
}
// 开启新的输出缓冲
ob_start();
$response = [
'err_code' => 0,
'code' => 0,
'err_msg' => 'ok',
'data' => $list['data'],
'count' => $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-Length: ' . strlen($response));
echo $response;
header('Content-Type: application/json; charset=utf-8');
header('Content-Length: ' . $length);
echo $content;
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