删除冗余代码

This commit is contained in:
JaguarJack 2020-04-22 06:07:53 +08:00
parent 6b227688e4
commit 57abdd4fd9

View File

@ -1,51 +1,11 @@
<?php
namespace catchAdmin\index\controller;
use catchAdmin\permissions\model\Permissions;
use catchAdmin\user\Auth;
use catcher\base\CatchController;
use catcher\CatchAuth;
use catcher\Tree;
use think\facade\Db;
class Index extends CatchController
{
/**
*
* @time 2019年12月11日
* @return string
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\DataNotFoundException
*/
public function index(): string
{
$user = (new CatchAuth())->user();
$permissionIds = $user->getPermissionsBy();
$menus = Permissions::whereIn('id', $permissionIds)
->where('type', Permissions::MENU_TYPE)
->field(['id', 'parent_id', 'permission_name', 'route'])
->select()->toArray();
return $this->fetch([
'menus' => Tree::done($menus),
'username' => $user->username,
]);
}
/**
*
* @time 2019年12月11日
* @throws \Exception
* @return string
*/
public function theme(): string
{
return $this->fetch();
}
/**
*
* @time 2019年12月12日