项目初始化

This commit is contained in:
2026-03-18 15:54:43 +08:00
commit dfcd762e23
601 changed files with 57883 additions and 0 deletions

23
extend/ba/Exception.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
namespace ba;
/**
* BuildAdmin通用异常类
* catch 到异常后可以直接 $this->error(__($e->getMessage()), $e->getData(), $e->getCode());
*/
class Exception extends \Exception
{
protected array $data = [];
public function __construct(string $message = '', int $code = 0, array $data = [], ?\Throwable $previous = null)
{
$this->data = $data;
parent::__construct($message, $code, $previous);
}
public function getData(): array
{
return $this->data;
}
}