更新内核
This commit is contained in:
@@ -27,17 +27,25 @@ class Json extends Response
|
||||
* @access protected
|
||||
* @param mixed $data 要处理的数据
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function output($data)
|
||||
{
|
||||
// 返回JSON数据格式到客户端 包含状态信息
|
||||
$data = json_encode($data, $this->options['json_encode_param']);
|
||||
try {
|
||||
// 返回JSON数据格式到客户端 包含状态信息
|
||||
$data = json_encode($data, $this->options['json_encode_param']);
|
||||
|
||||
if ($data === false) {
|
||||
throw new \InvalidArgumentException(json_last_error_msg());
|
||||
if ($data === false) {
|
||||
throw new \InvalidArgumentException(json_last_error_msg());
|
||||
}
|
||||
|
||||
return $data;
|
||||
} catch (\Exception $e) {
|
||||
if ($e->getPrevious()) {
|
||||
throw $e->getPrevious();
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,21 +30,29 @@ class Jsonp extends Response
|
||||
* @access protected
|
||||
* @param mixed $data 要处理的数据
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function output($data)
|
||||
{
|
||||
// 返回JSON数据格式到客户端 包含状态信息 [当url_common_param为false时是无法获取到$_GET的数据的,故使用Request来获取<xiaobo.sun@qq.com>]
|
||||
$var_jsonp_handler = Request::instance()->param($this->options['var_jsonp_handler'], "");
|
||||
$handler = !empty($var_jsonp_handler) ? $var_jsonp_handler : $this->options['default_jsonp_handler'];
|
||||
try {
|
||||
// 返回JSON数据格式到客户端 包含状态信息 [当url_common_param为false时是无法获取到$_GET的数据的,故使用Request来获取<xiaobo.sun@qq.com>]
|
||||
$var_jsonp_handler = Request::instance()->param($this->options['var_jsonp_handler'], "");
|
||||
$handler = !empty($var_jsonp_handler) ? $var_jsonp_handler : $this->options['default_jsonp_handler'];
|
||||
|
||||
$data = json_encode($data, $this->options['json_encode_param']);
|
||||
$data = json_encode($data, $this->options['json_encode_param']);
|
||||
|
||||
if ($data === false) {
|
||||
throw new \InvalidArgumentException(json_last_error_msg());
|
||||
if ($data === false) {
|
||||
throw new \InvalidArgumentException(json_last_error_msg());
|
||||
}
|
||||
|
||||
$data = $handler . '(' . $data . ');';
|
||||
return $data;
|
||||
} catch (\Exception $e) {
|
||||
if ($e->getPrevious()) {
|
||||
throw $e->getPrevious();
|
||||
}
|
||||
throw $e;
|
||||
}
|
||||
|
||||
$data = $handler . '(' . $data . ');';
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -53,10 +53,10 @@ class Redirect extends Response
|
||||
{
|
||||
if (is_array($name)) {
|
||||
foreach ($name as $key => $val) {
|
||||
Session::set($key, $val);
|
||||
Session::flash($key, $val);
|
||||
}
|
||||
} else {
|
||||
Session::set($name, $value);
|
||||
Session::flash($name, $value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user