From 3197598236e023f5ea7b9ee1e29cccde55165cbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=A8=E8=9B=8B=E6=B5=B7=E7=BB=B5?= <1037886804@qq.com> Date: Fri, 11 Sep 2020 12:59:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Config.example.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Config.example.php b/Config.example.php index a9edb71..1432da0 100644 --- a/Config.example.php +++ b/Config.example.php @@ -2,6 +2,8 @@ return [ // 网站名 'site_name' => 'XXX 的博客', + // 时区 + 'TimeZone' => 'Asia/Shanghai', // 支持跨域访问的域名 'allow_origin' => [ 'http://localhost:8080' // 或 '*' 跨域无限制 From 013a5d8f7da8bf747ebf230040b7adbb0c2d6b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=A8=E8=9B=8B=E6=B5=B7=E7=BB=B5?= <1037886804@qq.com> Date: Fri, 11 Sep 2020 13:00:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/Action.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/components/Action.php b/app/components/Action.php index 8af4e7c..d3b6a0b 100644 --- a/app/components/Action.php +++ b/app/components/Action.php @@ -77,6 +77,7 @@ public function actionCommentAdd() $comment->page_key = $pageKey; $comment->rid = $rid; $comment->ua = $ua; + $TimeZone = date_default_timezone_set(_config()['TimeZone']); $comment->date = date("Y-m-d H:i:s"); $comment->ip = $this->getUserIP(); $comment->is_collapsed = false;