Commit 1a4e02a6 authored by tufengqi's avatar tufengqi

fix response

parent 8d2cfcf6
......@@ -6,6 +6,7 @@ class BaseConstant
{
const ERROR = 'error';
const MSG = 'msg';
const MESSAGE = 'message';
const CODE = 'code';
const VAL = 'val';
const DATA = 'data';
......
......@@ -32,12 +32,12 @@ class ResponseMsg
public function arrSuccess($data = 'ok', $code = 200)
{
return [BaseConstant::ERROR => false, BaseConstant::MSG => $data, BaseConstant::CODE => $code];
return [BaseConstant::ERROR => false, BaseConstant::MESSAGE => $data, BaseConstant::CODE => $code];
}
public function arrFail($data, $code = -1)
{
return [BaseConstant::ERROR => true, BaseConstant::MSG => $data, BaseConstant::CODE => $code];
return [BaseConstant::ERROR => true, BaseConstant::MESSAGE => $data, BaseConstant::CODE => $code];
}
/**
......@@ -69,7 +69,7 @@ class ResponseMsg
{
$view = [
BaseConstant::CODE => $code,
BaseConstant::MSG => BaseConstant::OK,
BaseConstant::MESSAGE => BaseConstant::OK,
BaseConstant::DATA => $data
];
$json = json_encode($view);
......
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