Commit 499661ec authored by tufengqi's avatar tufengqi

输出帮助类修改

parent 89dc771c
......@@ -35,7 +35,7 @@ class ResponseApi
'msg' => $msg,
];
$json = json_encode($view);
self::dumpJsonData($json, $flag);
return self::dumpJsonData($json, $flag);
}
/**
......@@ -52,7 +52,7 @@ class ResponseApi
BaseConstant::VAL => $msg
];
$json = json_encode($view);
self::dumpJsonData($json, $flag);
return self::dumpJsonData($json, $flag);
}
/**
......@@ -74,7 +74,7 @@ class ResponseApi
* @param $json
* @param string $flag
*/
public static function dumpJsonData($json, $flag = '')
public static function dumpJsonData($json)
{
$callback = '';
if (true === self::$is_support_jsonp) {
......@@ -89,10 +89,7 @@ class ResponseApi
if (!$callback) {
self::header('Content-type', 'application/json');
}
echo $json;
if (BaseConstant::FINALTAG === $flag) {
exit;
}
return $json;
}
/**
......@@ -108,10 +105,10 @@ class ResponseApi
if ($callback) {
$callback = Html::encode($callback_key);
self::header('Content-type', 'application/javascript');
echo $callback . '(' . $json_str . ')';
return $callback . '(' . $json_str . ')';
} else {
self::header('Content-type', 'application/json');
echo $json_str;
return $json_str;
}
}
/**
......@@ -127,10 +124,10 @@ class ResponseApi
if ($callback) {
$callback = Html::encode($callback_key);
self::header('Content-type', 'application/javascript');
echo $callback . '(' . json_encode($arr) . ')';
return $callback . '(' . json_encode($arr) . ')';
} else {
self::header('Content-type', 'application/json');
echo json_encode($arr);
return json_encode($arr);
}
}
......@@ -149,10 +146,10 @@ class ResponseApi
if ($callback) {
$callback = Html::encode($callback_key);
self::header('Content-type', 'application/javascript');
echo $callback . '(' . json_encode($arr) . ')';
return $callback . '(' . json_encode($arr) . ')';
} else {
self::header('Content-type', 'application/json');
echo json_encode($arr);
return json_encode($arr);
}
}
......
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