fix: 修复redis密码 优化权限
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user