From b21df0a8f421161023f8c290ade74153b84f7394 Mon Sep 17 00:00:00 2001 From: jbrazz <2436953959@qq.com> Date: Thu, 7 Nov 2019 14:50:36 +0800 Subject: [PATCH 1/2] upt --- Application/Admin/Model/MemberModel.class.php | 2 +- Application/Common/Common/function.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Model/MemberModel.class.php b/Application/Admin/Model/MemberModel.class.php index ed1365e8d..49ac7baf0 100644 --- a/Application/Admin/Model/MemberModel.class.php +++ b/Application/Admin/Model/MemberModel.class.php @@ -79,7 +79,7 @@ class MemberModel extends Model { ); session('user_auth', $auth); session('user_auth_sign', data_auth_sign($auth)); - setcookie(session_name(),session_id(),time()+3600); + session('user_auth_expire', time()); } public function getNickName($uid){ diff --git a/Application/Common/Common/function.php b/Application/Common/Common/function.php index d3a793b4e..540686488 100644 --- a/Application/Common/Common/function.php +++ b/Application/Common/Common/function.php @@ -23,10 +23,19 @@ const ONETHINK_ADDON_PATH = './Addons/'; */ function is_login() { + // 判断是否过期 过期时间一个小时 + $expire = 3600; $user = session('user_auth'); if (empty($user)) { return 0; } else { + if (time() - intval(session('user_auth_expire')) > $expire) { // 过期正则直接去除掉session 并且返回false + session('user_auth', null); + session('user_auth_sign', null); + return 0; + } else { + session('user_auth_expire', time() + $expire); + } return session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0; } } From ce008b284e9bf6c009c61d2dfedf18c7673e77e7 Mon Sep 17 00:00:00 2001 From: zyx Date: Thu, 7 Nov 2019 14:52:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9C=88=E7=BB=93=E7=BB=9F=E8=AE=A1bug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Controller/FinanceController.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Application/Admin/Controller/FinanceController.class.php b/Application/Admin/Controller/FinanceController.class.php index 2e46bce51..c4dcc6a47 100644 --- a/Application/Admin/Controller/FinanceController.class.php +++ b/Application/Admin/Controller/FinanceController.class.php @@ -383,7 +383,7 @@ class FinanceController extends ThinkController if ($page == 1) { $parentData = $this->getParentSpendData($root_id,$month,2); } - $map['chain'] =['like','%'.$root_id.'%']; + $map['chain'] =['like','%/'.$root_id.'/%']; $map['level'] = 2; } else if(!empty(I("sign"))){ $map['parent_id'] = ['neq',0]; @@ -461,7 +461,7 @@ class FinanceController extends ThinkController if ($page == 1) { $parentData = $this->getParentSpendData($root_id,$month,3); } - $map['chain'] =['like','%'.$root_id.'%']; + $map['chain'] =['like','%/'.$root_id.'/%']; $map['level'] = 3; } else if(!empty(I("sign"))){ @@ -539,7 +539,7 @@ class FinanceController extends ThinkController $parentData = $this->getParentSpendData($parent_id,$month,4); } - $map['chain'] =['like','%'.$parent_id.'%']; + $map['chain'] =['like','%/'.$parent_id.'/%']; $map['level'] = 4; }