Commit fd73782d authored by ZhuChunYang's avatar ZhuChunYang

正确返回200

parent 75fb0bc4
...@@ -30,10 +30,13 @@ class BaseResponse extends Response ...@@ -30,10 +30,13 @@ class BaseResponse extends Response
$return['code'] = 1; $return['code'] = 1;
$return['msg'] = '数据为空'; $return['msg'] = '数据为空';
} elseif (is_array($data) && !isset($data['code'])) { } elseif (is_array($data) && !isset($data['code'])) {
$return['code'] = 0; $return['code'] = 200;
$return['count'] = count($data); $return['count'] = count($data);
$return['data'] = $data; $return['data'] = $data;
} else { } else {
if($data['code'] == 0){
$data['code'] = 200;
}
$return = $data; $return = $data;
} }
if (YII_ENV_DEV) { if (YII_ENV_DEV) {
......
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