From 39d8429a939efe54d4e8feb4e385fb561940371e Mon Sep 17 00:00:00 2001 From: kokororin Date: Sat, 15 Jul 2017 14:31:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9A=B4=E9=9C=B2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BB=A5=E6=94=AF=E6=8C=81pjax=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Action.php | 8 +++++--- Plugin.php | 5 ++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Action.php b/Action.php index ba7d71b..59b5989 100644 --- a/Action.php +++ b/Action.php @@ -1,4 +1,6 @@ response = Typecho_Response::getInstance(); $this->request = Typecho_Request::getInstance(); - require_once __DIR__ . '/Access_Autoloader.php'; - Access_Autoloader::register(); $this->access = new Access_Core(); } @@ -27,7 +27,9 @@ class Access_Action implements Widget_Interface_Do { $image = base64_decode('R0lGODlhAQABAIAAAAAAAP///yH5BAQUAP8ALAAAAAABAAEAAAICRAEAOw=='); $this->response->setContentType('image/gif'); - $this->access->writeLogs(null, $this->request->u, $this->request->cid, $this->request->mid); + if ($this->access->config->writeType == 1) { + $this->access->writeLogs(null, $this->request->u, $this->request->cid, $this->request->mid); + } echo $image; } diff --git a/Plugin.php b/Plugin.php index eef729d..f631dc5 100644 --- a/Plugin.php +++ b/Plugin.php @@ -74,7 +74,7 @@ class Access_Plugin implements Typecho_Plugin_Interface 'writeType', array( '0' => '后端', '1' => '前端', - ), '0', '日志写入类型:', '请选择日志写入类型,数据量大时(几万以上),后端写入可能会拖慢博客访问速度'); + ), '0', '日志写入类型:', '请选择日志写入类型,如果写入速度较慢可选择前端写入日志。
如果您使用了pjax,请在pjax相关事件中调用 window.Access.track() 方法。'); $canAnalytize = new Typecho_Widget_Helper_Form_Element_Radio( 'canAnalytize', array( '0' => '不允许', @@ -197,8 +197,7 @@ class Access_Plugin implements Typecho_Plugin_Interface $index = rtrim(Helper::options()->index, '/'); $access = new Access_Core(); $parsedArchive = $access->parseArchive($archive); - // TODO 兼容pjax - echo ""; + echo ""; } }