mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-02 13:12:49 +08:00
规范 JSONP 和 EVAL 的 ContentType 类型
This commit is contained in:
@@ -91,12 +91,12 @@ class Controller {
|
||||
exit(xml_encode($data));
|
||||
case 'JSONP':
|
||||
// 返回JSON数据格式到客户端 包含状态信息
|
||||
header('Content-Type:application/json; charset=utf-8');
|
||||
header('Content-Type:application/javascript; charset=utf-8');
|
||||
$handler = isset($_GET[C('var_jsonp_handler')]) ? $_GET[C('var_jsonp_handler')] : C('default_jsonp_handler');
|
||||
exit($handler . '(' . json_encode($data) . ');');
|
||||
case 'EVAL':
|
||||
// 返回可执行的js脚本
|
||||
header('Content-Type:text/html; charset=utf-8');
|
||||
header('Content-Type:application/javascript; charset=utf-8');
|
||||
exit($data);
|
||||
default:
|
||||
// 用于扩展其他返回格式数据
|
||||
|
||||
Reference in New Issue
Block a user