From 1f63b01b11aa92a43150998684b392995a9d5159 Mon Sep 17 00:00:00 2001 From: longdahai <86127779@qq.com> Date: Thu, 28 Mar 2019 18:07:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?mod=20header=E6=94=B9=E4=B8=BAresponse?= =?UTF-8?q?=E5=8F=91=E9=80=81=20=E5=85=BC=E5=AE=B9swoole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Ajax.php | 3 +-- application/index/controller/Ajax.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/application/admin/controller/Ajax.php b/application/admin/controller/Ajax.php index 828e228d2..581be26df 100644 --- a/application/admin/controller/Ajax.php +++ b/application/admin/controller/Ajax.php @@ -34,11 +34,10 @@ class Ajax extends Backend */ public function lang() { - header('Content-Type: application/javascript'); $controllername = input("controllername"); //默认只加载了控制器对应的语言名,你还根据控制器名来加载额外的语言包 $this->loadlang($controllername); - return jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); + return jsonp(Lang::get(), 200, ['Content-Type' => 'application/javascript'], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); } /** diff --git a/application/index/controller/Ajax.php b/application/index/controller/Ajax.php index fda48511e..b27cc3c8a 100644 --- a/application/index/controller/Ajax.php +++ b/application/index/controller/Ajax.php @@ -21,12 +21,11 @@ class Ajax extends Frontend */ public function lang() { - header('Content-Type: application/javascript'); $callback = $this->request->get('callback'); $controllername = input("controllername"); $this->loadlang($controllername); //强制输出JSON Object - $result = jsonp(Lang::get(), 200, [], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); + $result = jsonp(Lang::get(), 200, ['Content-Type' => 'application/javascript'], ['json_encode_param' => JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE]); return $result; } -- Gitee From 17fc3b204e711f9054f0da102b3823a5eecf7eb3 Mon Sep 17 00:00:00 2001 From: longdahai <86127779@qq.com> Date: Thu, 28 Mar 2019 18:40:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?mod=20=E5=AE=8F=E5=AE=9A=E4=B9=89=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E9=9D=99=E6=80=81=E5=8F=98=E9=87=8F=E5=85=BC=E5=AE=B9?= =?UTF-8?q?swoole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/view/layout/default.html | 4 ++-- application/common/controller/Backend.php | 10 ++++++---- application/common/library/Fast.php | 17 +++++++++++++++++ 3 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 application/common/library/Fast.php diff --git a/application/admin/view/layout/default.html b/application/admin/view/layout/default.html index 0541a26a2..bf4e60d50 100644 --- a/application/admin/view/layout/default.html +++ b/application/admin/view/layout/default.html @@ -4,7 +4,7 @@ {include file="common/meta" /} -
+