diff --git a/app/ExceptionHandle.php b/app/ExceptionHandle.php index 5a358e0..5886b8d 100644 --- a/app/ExceptionHandle.php +++ b/app/ExceptionHandle.php @@ -9,6 +9,7 @@ use think\exception\HttpResponseException; use think\exception\ValidateException; use think\Response; use Throwable; +use cores\exception\BaseException; /** * 应用异常处理类 diff --git a/app/api/config.php b/app/api/config.php index e69de29..8146b62 100644 --- a/app/api/config.php +++ b/app/api/config.php @@ -0,0 +1,3 @@ + [ Env::get('easyadmin.admin', 'douyin') => 'admin', + 'api' => 'api', ], // 后台别名 'admin_alias_name' => Env::get('easyadmin.admin', 'douyin'), diff --git a/cores/exception/BaseException.php b/cores/exception/BaseException.php index 27a0404..a818721 100644 --- a/cores/exception/BaseException.php +++ b/cores/exception/BaseException.php @@ -29,7 +29,7 @@ class BaseException extends Exception public function __construct($params = []) { parent::__construct(); - $this->status = $params['status'] ?? config('status.error'); + $this->status = $params['status'] ?? 1000; $this->message = $params['message'] ?? '很抱歉,服务器内部错误'; $this->data = $params['data'] ?? []; }