update:更新权限系统

This commit is contained in:
JaguarJack
2021-03-31 20:20:21 +08:00
parent d4020b93a3
commit 2b96f3b650
15 changed files with 582 additions and 7 deletions

View File

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

View File

@@ -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']);
}
// 添加角色