1
0
mirror of https://gitee.com/apiadmin/ApiAdmin.git synced 2025-04-27 11:46:34 +08:00

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

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

@ -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'));
}