Commit 902c8a53 authored by tufengqi's avatar tufengqi

返回格式修改

parent 312da40d
...@@ -8,6 +8,7 @@ class BaseConstant ...@@ -8,6 +8,7 @@ class BaseConstant
const MSG = 'msg'; const MSG = 'msg';
const CODE = 'code'; const CODE = 'code';
const VAL = 'val'; const VAL = 'val';
const DATA = 'data';
const OK = 'ok'; const OK = 'ok';
const FINALTAG = 'finaltag'; const FINALTAG = 'finaltag';
} }
...@@ -65,12 +65,12 @@ class ResponseMsg ...@@ -65,12 +65,12 @@ class ResponseMsg
* @param int $code * @param int $code
* @return string * @return string
*/ */
public function jsonSuccess($msg = '', $code = 0) public function jsonSuccess($data = '', $code = 200)
{ {
$view = [ $view = [
BaseConstant::CODE => $code, BaseConstant::CODE => $code,
BaseConstant::MSG => BaseConstant::OK, BaseConstant::MSG => BaseConstant::OK,
BaseConstant::VAL => $msg BaseConstant::DATA => $data
]; ];
$json = json_encode($view); $json = json_encode($view);
return $this->dumpJsonData($json); return $this->dumpJsonData($json);
......
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