fix: 修复redis密码 优化权限

This commit is contained in:
Ying
2023-08-04 11:13:14 +08:00
parent 87c4137912
commit 732a385498
14 changed files with 110 additions and 46 deletions

View File

@@ -57,6 +57,11 @@ class ExceptionHandle extends ExceptionHandler
{
switch (true) {
case $exception instanceof OperateException:
return json([
'code' => $exception->getCode() ?? 101,
'msg' => $exception->getMessage(),
'data' => $exception->getData()
]);
case $exception instanceof ValidateException:
return json(['code' => $exception->getCode() ?? 101, 'msg' => $exception->getMessage()]);
case $exception instanceof DumpException:

View File

@@ -24,4 +24,13 @@ class OperateException extends \Exception
$this->message = $message ?: ResultCode::UNKNOWN['msg'];
parent::__construct($this->message, $this->code, $previous);
}
/**
* 获取附加数据
* @return array
*/
public function getData(): array
{
return $this->data;
}
}