Commit 9e1e92aa by zhufx
parents 8c41e667 740d3422
...@@ -31,7 +31,7 @@ class BaseController ...@@ -31,7 +31,7 @@ class BaseController
*/ */
public static function error(int $errorCode, string $msg, $data=null) { public static function error(int $errorCode, string $msg, $data=null) {
return [ return [
'error_code' => $errorCode, 'errorCode' => $errorCode,
'msg' => $msg, 'msg' => $msg,
'data' => $data, 'data' => $data,
]; ];
...@@ -48,7 +48,7 @@ class BaseController ...@@ -48,7 +48,7 @@ class BaseController
return [ return [
'data' => $data, 'data' => $data,
'msg' => $msg, 'msg' => $msg,
'error_code' => 0, 'errorCode' => 0,
]; ];
} }
} }
\ No newline at end of file
...@@ -24,8 +24,8 @@ class BaseException extends Exception ...@@ -24,8 +24,8 @@ class BaseException extends Exception
$this->message = $params['msg']; $this->message = $params['msg'];
} }
if(isset($params['error_code'])){ if(isset($params['errorCode'])){
$this->errorCode = $params['error_code']; $this->errorCode = $params['errorCode'];
} }
parent::__construct($this->message, $this->code); parent::__construct($this->message, $this->code);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment