update:更新权限系统
This commit is contained in:
@@ -100,6 +100,7 @@ class Permission extends CatchController
|
||||
$permission = $this->permissions->findBy($id);
|
||||
|
||||
$params = $request->param();
|
||||
|
||||
// 按钮类型
|
||||
if ($params['type'] == Permissions::BTN_TYPE && $permission->parent_id) {
|
||||
$parentPermission = $this->permissions->findBy($permission->parent_id);
|
||||
|
@@ -7,7 +7,6 @@ use catcher\base\CatchRequest as Request;
|
||||
use catcher\base\CatchController;
|
||||
use catcher\CatchResponse;
|
||||
use catcher\exceptions\FailedException;
|
||||
use catcher\Tree;
|
||||
use think\response\Json;
|
||||
use catchAdmin\permissions\model\Roles as RoleModel;
|
||||
|
||||
@@ -51,7 +50,7 @@ class Role extends CatchController
|
||||
$this->role->attachPermissions(array_unique($params['permissions']));
|
||||
}
|
||||
// 分配部门
|
||||
if (count($params['departments'])) {
|
||||
if (isset($params['departments']) && count($params['departments'])) {
|
||||
$this->role->attachDepartments($params['departments']);
|
||||
}
|
||||
// 添加角色
|
||||
|
Reference in New Issue
Block a user