90 lines
2.5 KiB
PHP
90 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace app\common\controller;
|
|
|
|
use app\admin\service\RoleService;
|
|
use app\common\service\BrandSeriesService;
|
|
use app\common\service\BrandService;
|
|
use app\common\service\SysAccountService;
|
|
use app\common\service\SysCurrencyService;
|
|
use app\common\service\SysDictItemService;
|
|
use app\common\service\SysDictService;
|
|
use app\common\service\SysPortService;
|
|
use app\common\service\VehColorService;
|
|
use app\common\service\VehModificationService;
|
|
use support\Request;
|
|
use app\common\service\CorpService;
|
|
use app\common\service\CorpFeishuAppService;
|
|
use app\common\service\SystemsService;
|
|
use app\common\service\UserService;
|
|
use support\Cache;
|
|
use app\common\service\PermService;
|
|
use app\common\service\UserGroupService;
|
|
|
|
class PresetController extends BaseController
|
|
{
|
|
|
|
protected $noNeedLogin = ['systems'];
|
|
|
|
protected $noNeedHeaderData = ['systems'];
|
|
|
|
|
|
public function systems()
|
|
{
|
|
try {
|
|
$result = (new SystemsService())->getList();
|
|
return $this->success($result, '获取系统列表');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
public function users()
|
|
{
|
|
try {
|
|
$result = (new UserService())->getList();
|
|
return $this->success($result, '获取用户列表');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
public function roles()
|
|
{
|
|
try {
|
|
$result = (new RoleService)->getList();
|
|
return $this->success($result, '获取角色列表');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
public function cacheClear()
|
|
{
|
|
try {
|
|
Cache::clear();
|
|
return $this->success([], '操作成功');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
public function menus(Request $request)
|
|
{
|
|
try {
|
|
$uid = $request->user->uid;
|
|
$systemCode = $request->system_code;
|
|
$permService = new PermService();
|
|
$menuTree = $permService->getMenuTree($uid, $systemCode);
|
|
$permissionCodes = $permService->getPermissionCodes($uid, $systemCode);
|
|
$result = [
|
|
'menu' => $menuTree,
|
|
'permissions' => $permissionCodes
|
|
];
|
|
return $this->success($result, '获取菜单权限');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
} |