mirror of https://github.com/1099438829/apeblog
修正后台错误
This commit is contained in:
parent
1e51b08807
commit
8dfa7bbd04
|
|
@ -25,6 +25,8 @@ class Index extends AuthController
|
|||
cache(AdminAuth::getMenuCacheKey($this->adminId),$menuList,1*60*60);
|
||||
}
|
||||
$this->assign("menu",$menuList);
|
||||
$message = ['data'=>[],'count'=>0];
|
||||
$this->assign("message",$message);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ class Admin extends BaseModel
|
|||
*/
|
||||
public static function setLoginInfo($info)
|
||||
{
|
||||
unset($info->pwd);//去除密码字段
|
||||
$info->role_auth = AdminRole::getAuth($info['role_id'] ?? 0);//提前缓存auth字段避免频繁查询
|
||||
Session::set("adminId",$info['id']);
|
||||
Session::set("adminInfo",$info->toArray());
|
||||
event("AdminLog",[$info->toArray(),"admin","login","login"]);
|
||||
|
|
@ -132,6 +134,7 @@ class Admin extends BaseModel
|
|||
$model = $model->where("id",$id);
|
||||
$model = $model->field($field);
|
||||
$info = $model->find();
|
||||
unset($info->pwd);
|
||||
return $info ? $info->toArray() : [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,6 +52,17 @@ class AdminAuth extends BaseModel
|
|||
return $data->toArray() ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取菜单列表缓存key
|
||||
* @param $adminId
|
||||
* @return string
|
||||
* @author 李玉坤
|
||||
* @date 2021-06-09 17:24
|
||||
*/
|
||||
public static function getMenuCacheKey($adminId){
|
||||
return 'menu:List:'.$adminId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 权限列表
|
||||
* @param $where
|
||||
|
|
|
|||
|
|
@ -213,10 +213,10 @@
|
|||
<!--切换主题配色-->
|
||||
<!--消息-->
|
||||
<li class="dropdown notifications-menu">
|
||||
<span class="dropdown-toggle icon-notifications" data-toggle="dropdown">
|
||||
<i class="mdi mdi-bell"></i>
|
||||
<span class="label label-warning">{$message.count}</span>
|
||||
</span>
|
||||
<span class="dropdown-toggle icon-notifications" data-toggle="dropdown">
|
||||
<i class="mdi mdi-bell"></i>
|
||||
<span class="label label-warning">{$message.count}</span>
|
||||
</span>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li class="header">您有{$message.count}个未读消息</li>
|
||||
<li>
|
||||
|
|
|
|||
Loading…
Reference in New Issue