36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Http\Controllers\Api;
|
||
|
|
|
||
|
|
use App\BaseApp\BaseController;
|
||
|
|
use App\Service\MenuService;
|
||
|
|
|
||
|
|
class MenuController extends BaseController
|
||
|
|
{
|
||
|
|
//
|
||
|
|
public function __construct()
|
||
|
|
{
|
||
|
|
parent::__construct();
|
||
|
|
$this->insertField = [ 'pid', 'title', 'icon', 'path', 'affix_tab', 'keep_alive', 'hide_in_menu', 'sort' ];
|
||
|
|
$this->updateField = [ 'id', 'pid', 'title', 'icon', 'path', 'affix_tab', 'redirect', 'keep_alive', 'hide_in_menu', 'badge_variants', 'sort' ];
|
||
|
|
$this->notRequest = [ 'name', 'badge', 'iframe_src', 'redirect', 'query', 'badge_type', 'badge_variants', 'component' ];
|
||
|
|
$this->service = MenuService::getInstance();
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取菜单树形下拉列表
|
||
|
|
* @Method GET
|
||
|
|
* @return \Illuminate\Http\JsonResponse
|
||
|
|
* @throws \Psr\Container\ContainerExceptionInterface
|
||
|
|
* @throws \Psr\Container\NotFoundExceptionInterface
|
||
|
|
*/
|
||
|
|
public function getTreeOption()
|
||
|
|
{
|
||
|
|
$isSelect = request()->get('is_select', false);
|
||
|
|
return jok(
|
||
|
|
$this->service->getTreeOption($isSelect)
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|