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

输出类常量修改

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