This commit is contained in:
2025-08-13 20:28:23 +08:00
parent 537426593a
commit 7f48675193
9 changed files with 92 additions and 29 deletions

View File

@@ -54,6 +54,7 @@ class BaseController
$this->error('Token expiration', [], 409);
}
};
if ($needLogin) {
$this->error('Token expiration', [], 409);
}
@@ -144,7 +145,7 @@ class BaseController
{
$data['code'] = $code;
$data['message'] = $msg;
$data['time'] = $this->request->server('REQUEST_TIME');
$data['time'] = time();
if(isset($data['data']['records'])) {
$data['data']['records'] = apiconvertToCamelCase($data['data']['records']);
}
@@ -159,12 +160,7 @@ class BaseController
}
$result = $data;
$type = $type ?: $this->responseType;
$response = new Response();
$response->header('Content-Type', $type);
$response->withBody($result);
return $response;
throw new MyBusinessException(json_encode($result));
}