mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
added 代码备份
This commit is contained in:
parent
b34d8e6723
commit
0924b0cdfc
@ -9,6 +9,8 @@ namespace app\admin\controller;
|
|||||||
|
|
||||||
|
|
||||||
use app\model\ApiAuthGroup;
|
use app\model\ApiAuthGroup;
|
||||||
|
use app\model\ApiAuthRule;
|
||||||
|
use app\model\ApiMenu;
|
||||||
use app\model\ApiUser;
|
use app\model\ApiUser;
|
||||||
use app\util\ReturnCode;
|
use app\util\ReturnCode;
|
||||||
|
|
||||||
@ -40,6 +42,28 @@ class Auth extends Base {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getRuleList() {
|
||||||
|
$groupId = $this->request->get('groupId', 0);
|
||||||
|
|
||||||
|
$list = (new ApiMenu)->where([])->order('sort', 'ASC')->select();
|
||||||
|
$list = $this->buildArrFromObj($list);
|
||||||
|
$list = listToTree($list);
|
||||||
|
|
||||||
|
if ($groupId) {
|
||||||
|
$rules = (new ApiAuthRule())->where(['groupId' => $groupId])->select();
|
||||||
|
$rules = array_column($rules, 'url');
|
||||||
|
}
|
||||||
|
|
||||||
|
$newList = [];
|
||||||
|
foreach ($list as $key => $value) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->buildSuccess([
|
||||||
|
'list' => $newList
|
||||||
|
], '登录成功');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户 等待组权限
|
* 新增用户 等待组权限
|
||||||
* @return array
|
* @return array
|
||||||
|
@ -21,7 +21,7 @@ class Menu extends Base {
|
|||||||
*/
|
*/
|
||||||
public function index() {
|
public function index() {
|
||||||
$list = ApiMenu::all();
|
$list = ApiMenu::all();
|
||||||
$list = json_decode(json_encode($list), true);
|
$list = $this->buildArrFromObj($list);
|
||||||
$list = formatTree(listToTree($list));
|
$list = formatTree(listToTree($list));
|
||||||
|
|
||||||
return $this->buildSuccess([
|
return $this->buildSuccess([
|
||||||
|
@ -71,6 +71,10 @@ return [
|
|||||||
'admin/Auth/del',
|
'admin/Auth/del',
|
||||||
['method' => 'get', 'after_behavior' => $afterBehavior]
|
['method' => 'get', 'after_behavior' => $afterBehavior]
|
||||||
],
|
],
|
||||||
|
'Auth/getRuleList' => [
|
||||||
|
'admin/Auth/getRuleList',
|
||||||
|
['method' => 'get', 'after_behavior' => $afterBehavior]
|
||||||
|
],
|
||||||
'__miss__' => ['admin/Miss/index'],
|
'__miss__' => ['admin/Miss/index'],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user