$code, 'status' => $status, 'msg' => $msg, 'page' => $page, 'data' => $data ]); } /** * 抛出逻辑异常 * @throws LogicException * @deprecated 函数已弃用, 请使用 throw_logic_exception() */ public static function throw_logic_exception(string $msg = 'error', int $code = 1, string $status = 'error', mixed $data = [], int $httpCode = 200, $header = [], $options = []): void { throw new LogicException(error_response($msg, $status, $code, $data, $httpCode, $header, $options)); } /** * 返回失败数据 * @deprecated 函数已弃用, 请使用 error_response() */ public static function error_response(string $msg = 'error', string $status = 'error', int $code = 1, mixed $data = [], int $httpCode = 400, $header = [], $options = []): Response { return json([ 'code' => $code, 'status' => $status, 'msg' => $msg, 'data' => $data ], $httpCode, $header, $options); } }