From ae4cbd8e50e75489af4c00eb3011892e61b41c67 Mon Sep 17 00:00:00 2001 From: zhaoxiang <756958008@qq.com> Date: Sun, 20 Nov 2016 16:43:40 +0800 Subject: [PATCH] =?UTF-8?q?modified=20=E6=94=BE=E5=A4=A7=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E6=9D=83=E9=99=90=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Base.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/admin/controller/Base.php b/application/admin/controller/Base.php index 8b59c18..12370aa 100644 --- a/application/admin/controller/Base.php +++ b/application/admin/controller/Base.php @@ -51,7 +51,7 @@ class Base extends Controller { * @return mixed */ protected function _prepareTemplate( $temp ){ - if( isAdministrator() ){ + if( !isAdministrator() ){ $MenuInfo = Menu::where([])->column('hide','url'); $authList = (new \Permission())->getAuthList($this->uid); switch ( $temp['tempType'] ){ @@ -113,9 +113,9 @@ class Base extends Controller { $sidNow = session_id(); $sidOld = cache($this->uid); if( isset($sidOld) && !empty($sidOld) ){ - //if( $sidOld != $sidNow ){ - // $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login')); - //}else{ + if( $sidOld != $sidNow ){ + $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login')); + }else{ cache($this->uid, $sidNow, config('online_time')); $this->userInfo = User::get([ $this->primaryKey => $this->uid ])->toArray(); // if( $this->userInfo['updateTime'] === 0 ){ @@ -125,7 +125,7 @@ class Base extends Controller { // $this->error('初次登录请设置用户昵称!', url('User/changeNickname')); // } // } - //} + } }else{ $this->error("登录超时,请重新登录!", url('User/login')); }