diff --git a/application/admin/view/config.index.html b/application/admin/view/config.index.html index 4814e8d17..74e61348c 100644 --- a/application/admin/view/config.index.html +++ b/application/admin/view/config.index.html @@ -49,6 +49,14 @@ +
+ +
+ +

友盟统计应用ID,可以在友盟网站统计申请并获取

+
+
+
diff --git a/extend/hook/FilterView.php b/extend/hook/FilterView.php index 29a267667..e7fb05200 100644 --- a/extend/hook/FilterView.php +++ b/extend/hook/FilterView.php @@ -25,20 +25,29 @@ use think\Request; */ class FilterView { + /** + * 当前请求对象 + * @var Request + */ + protected $request; + /** * 行为入口 * @param $params */ public function run(&$params) { - $app = Request::instance()->root(true); + $this->request = Request::instance(); + $app = $this->request->root(true); $replace = [ '__APP__' => $app, - '__SELF__' => Request::instance()->url(true), + '__SELF__' => $this->request->url(true), '__PUBLIC__' => strpos($app, EXT) ? ltrim(dirname($app), DS) : $app, ]; $params = str_replace(array_keys($replace), array_values($replace), $params); - $this->baidu($params); - $this->cnzz($params); + if (!IS_CLI) { + $this->baidu($params); + $this->cnzz($params); + } } /** @@ -46,7 +55,7 @@ class FilterView { * @param $params */ public function baidu(&$params) { - if (!IS_CLI && ($key = sysconf('tongji_baidu_key'))) { + if (($key = sysconf('tongji_baidu_key'))) { $script = <<