modified 放大超级管理员权限细节

This commit is contained in:
zhaoxiang 2016-11-20 16:43:40 +08:00
parent 8b3a7a2cc2
commit ae4cbd8e50

View File

@ -51,7 +51,7 @@ class Base extends Controller {
* @return mixed * @return mixed
*/ */
protected function _prepareTemplate( $temp ){ protected function _prepareTemplate( $temp ){
if( isAdministrator() ){ if( !isAdministrator() ){
$MenuInfo = Menu::where([])->column('hide','url'); $MenuInfo = Menu::where([])->column('hide','url');
$authList = (new \Permission())->getAuthList($this->uid); $authList = (new \Permission())->getAuthList($this->uid);
switch ( $temp['tempType'] ){ switch ( $temp['tempType'] ){
@ -113,9 +113,9 @@ class Base extends Controller {
$sidNow = session_id(); $sidNow = session_id();
$sidOld = cache($this->uid); $sidOld = cache($this->uid);
if( isset($sidOld) && !empty($sidOld) ){ if( isset($sidOld) && !empty($sidOld) ){
//if( $sidOld != $sidNow ){ if( $sidOld != $sidNow ){
// $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login')); $this->error("您的账号在别的地方登录了,请重新登录!", url('User/login'));
//}else{ }else{
cache($this->uid, $sidNow, config('online_time')); cache($this->uid, $sidNow, config('online_time'));
$this->userInfo = User::get([ $this->primaryKey => $this->uid ])->toArray(); $this->userInfo = User::get([ $this->primaryKey => $this->uid ])->toArray();
// if( $this->userInfo['updateTime'] === 0 ){ // if( $this->userInfo['updateTime'] === 0 ){
@ -125,7 +125,7 @@ class Base extends Controller {
// $this->error('初次登录请设置用户昵称!', url('User/changeNickname')); // $this->error('初次登录请设置用户昵称!', url('User/changeNickname'));
// } // }
// } // }
//} }
}else{ }else{
$this->error("登录超时,请重新登录!", url('User/login')); $this->error("登录超时,请重新登录!", url('User/login'));
} }