This commit is contained in:
39
app/Controller/SystemController.php
Normal file
39
app/Controller/SystemController.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Author: ykxiao
|
||||
* Date: 2025/7/11
|
||||
* Time: 下午7:05
|
||||
* Description:
|
||||
*
|
||||
* (c) ykxiao <yk_9001@hotmail.com>
|
||||
*
|
||||
* This source file is subject to the MIT license that is bundled
|
||||
* with this source code in the file LICENSE.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Service\PermissionService;
|
||||
use Exception;
|
||||
use Hyperf\Di\Annotation\Inject;
|
||||
use Hyperf\HttpMessage\Server\Response;
|
||||
|
||||
class SystemController extends AbstractController
|
||||
{
|
||||
#[Inject]
|
||||
protected PermissionService $permissionService;
|
||||
|
||||
/**
|
||||
* 菜单列表
|
||||
* @throws Exception
|
||||
*/
|
||||
public function menuList(): Response
|
||||
{
|
||||
$user = $this->user();
|
||||
$menu = $this->permissionService->getMenuByUserType($user);
|
||||
|
||||
return $this->apiResponse->success($menu);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user