目录结构调整
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace think\response;
|
||||
|
||||
use think\Request;
|
||||
use think\Response;
|
||||
|
||||
class Jsonp extends Response
|
||||
@@ -32,8 +33,9 @@ class Jsonp extends Response
|
||||
*/
|
||||
protected function output($data)
|
||||
{
|
||||
// 返回JSON数据格式到客户端 包含状态信息
|
||||
$handler = !empty($_GET[$this->options['var_jsonp_handler']]) ? $_GET[$this->options['var_jsonp_handler']] : $this->options['default_jsonp_handler'];
|
||||
// 返回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 = $handler . '(' . json_encode($data, $this->options['json_encode_param']) . ');';
|
||||
return $data;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user