* [api] APIv1 esponse in entries.

This commit is contained in:
朱金勇
2025-12-08 09:40:38 +08:00
committed by Gitfox
parent 96e245ded1
commit 5c22586a67
+7 -3
View File
@@ -281,13 +281,17 @@ class control extends baseControl
*/
public function send($data, string $type = 'json')
{
/* APIv1 send json in entries. */
if($this->app->apiVersion == 'v1') return;
header('Content-Type: application/json');
if($type != 'json') return helper::end();
/* APIv1 send json in entries, print data for getData method. */
if($this->app->apiVersion == 'v1')
{
$response = helper::removeUTF8Bom(json_encode($data, JSON_UNESCAPED_UNICODE));
return print($response);
}
$data = (array)$data;
if(isset($data['result']))
{