新增权限方法获取
This commit is contained in:
parent
c06e7b8694
commit
f9ed43017f
@ -6,6 +6,7 @@ use catcher\base\CatchRequest as Request;
|
||||
use catcher\base\CatchController;
|
||||
use catcher\CatchResponse;
|
||||
use catcher\exceptions\FailedException;
|
||||
use catcher\library\ParseClass;
|
||||
use catcher\Tree;
|
||||
use catchAdmin\permissions\model\Permissions;
|
||||
use think\response\Json;
|
||||
@ -143,6 +144,23 @@ class Permission extends CatchController
|
||||
|
||||
return CatchResponse::success($permission->save());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @time 2020年06月05日
|
||||
* @param $id
|
||||
* @param ParseClass $parseClass
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @return Json
|
||||
*/
|
||||
public function getMethods($id, ParseClass $parseClass)
|
||||
{
|
||||
$methods = $parseClass->setModule('catch')->setRule(Permissions::where('id', $id)->find())->onlySelfMethods();
|
||||
|
||||
return CatchResponse::success($methods);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ $router->get('/role/get/permissions', '\catchAdmin\permissions\controller\Role@g
|
||||
// 权限
|
||||
$router->resource('permissions', '\catchAdmin\permissions\controller\Permission');
|
||||
$router->put('permissions/show/<id>', '\catchAdmin\permissions\controller\Permission@show');
|
||||
$router->get('controller/methods/<id>', '\catchAdmin\permissions\controller\Permission@getMethods');
|
||||
|
||||
// 部门
|
||||
$router->resource('departments', '\catchAdmin\permissions\controller\Department');
|
||||
|
1
extend/catcher/library/ParseClass.php
Normal file
1
extend/catcher/library/ParseClass.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
Loading…
x
Reference in New Issue
Block a user