Files
wh-api/app/Controller/SystemController.php
ykxiao 8a3ab17b25
Some checks failed
Build Docker / build (push) Has been cancelled
增加基础配置
2025-07-12 11:59:33 +08:00

39 lines
804 B
PHP

<?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);
}
}