Commit afac9e58 authored by tufengqi's avatar tufengqi Committed by tufengqi

输出类常量修改

parent fc723239
...@@ -39,7 +39,7 @@ class ResponseMsg ...@@ -39,7 +39,7 @@ class ResponseMsg
return self::$default_header_list; return self::$default_header_list;
} }
public function arrSuccess($data = 'ok', $code = 200) public function arrSuccess($data = BaseConstant::OK, $code = 200)
{ {
return [BaseConstant::ERROR => false, BaseConstant::MESSAGE => $data, BaseConstant::CODE => $code]; return [BaseConstant::ERROR => false, BaseConstant::MESSAGE => $data, BaseConstant::CODE => $code];
} }
...@@ -61,8 +61,8 @@ class ResponseMsg ...@@ -61,8 +61,8 @@ class ResponseMsg
$msg = 'unknown error'; $msg = 'unknown error';
} }
$view = [ $view = [
'code' => $code, BaseConstant::CODE => $code,
'msg' => $msg, BaseConstant::MESSAGE => $msg,
]; ];
$json = json_encode($view); $json = json_encode($view);
return $this->dumpJsonData($json); return $this->dumpJsonData($json);
...@@ -91,10 +91,10 @@ class ResponseMsg ...@@ -91,10 +91,10 @@ class ResponseMsg
*/ */
public function dealRet($ret) public function dealRet($ret)
{ {
if (true === $ret['error']) { if (true === $ret[BaseConstant::ERROR]) {
$this->jsonError($ret['msg'] ? : 'unknown error'); $this->jsonError($ret[BaseConstant::MESSAGE] ? : 'unknown error');
} else { } else {
$this->jsonSuccess($ret['msg'] ? : BaseConstant::OK); $this->jsonSuccess($ret[BaseConstant::MESSAGE] ? : BaseConstant::OK);
} }
} }
......
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