mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-08 02:52:49 +08:00
实现手动设计的权限管理
This commit is contained in:
@@ -27,7 +27,7 @@ class Admin extends Model
|
||||
return [];
|
||||
}
|
||||
|
||||
return AdminGroup::where('id',$this->getData('group_id'))->cache(1)->find();
|
||||
return AdminGroup::where('id',$this->getData('group_id'))->cache(60)->find();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,22 +19,5 @@ class AdminLog extends Model
|
||||
return $this->belongsTo('Admin','admin_id');
|
||||
}
|
||||
|
||||
public function getUrlAttr()
|
||||
{
|
||||
return AdminPermission::where([
|
||||
'app'=>$this->getData('app'),
|
||||
'controller'=>$this->getData('controller'),
|
||||
'action'=>$this->getData('action'),
|
||||
])->find();
|
||||
}
|
||||
|
||||
public function setParamAttr($value)
|
||||
{
|
||||
return json_encode($value,JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
|
||||
public function getParamAttr($value)
|
||||
{
|
||||
return \mb_substr($value,0,30);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,14 +22,5 @@ class AdminPermission extends Model
|
||||
return $status[intval($value)];
|
||||
}
|
||||
|
||||
public function getNameAttr($value)
|
||||
{
|
||||
if(empty($value)){
|
||||
$value = $this->getData('app').'/'.$this->getData('controller').'/'.$this->getData('action');
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user