2020-04-29 17:37:45 +08:00
|
|
|
<?php
|
2021-04-01 18:39:11 +08:00
|
|
|
|
|
|
|
/* @var think\Route $router */
|
|
|
|
|
2020-07-14 21:06:10 +08:00
|
|
|
$router->group(function () use ($router) {
|
2020-06-24 09:10:01 +08:00
|
|
|
// 登录日志
|
|
|
|
$router->get('log/login', '\catchAdmin\system\controller\LoginLog@list');
|
2020-09-25 10:47:20 +08:00
|
|
|
$router->delete('log/login/<id>', '\catchAdmin\system\controller\LoginLog@empty');
|
2020-06-24 09:10:01 +08:00
|
|
|
// 操作日志
|
|
|
|
$router->get('log/operate', '\catchAdmin\system\controller\OperateLog@list');
|
2020-09-04 16:21:18 +08:00
|
|
|
// $router->delete('empty/log/operate', '\catchAdmin\system\controller\OperateLog@empty');
|
|
|
|
$router->delete('log/operate/<id>', '\catchAdmin\system\controller\OperateLog@delete');
|
2020-04-29 17:37:45 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 数据字典
|
|
|
|
$router->get('tables', '\catchAdmin\system\controller\DataDictionary@tables');
|
|
|
|
$router->get('table/view/<table>', '\catchAdmin\system\controller\DataDictionary@view');
|
|
|
|
$router->post('table/optimize', '\catchAdmin\system\controller\DataDictionary@optimize');
|
|
|
|
$router->post('table/backup', '\catchAdmin\system\controller\DataDictionary@backup');
|
2020-04-29 17:37:45 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 上传
|
2021-01-20 20:30:04 +08:00
|
|
|
$router->group('upload', function () use ($router){
|
|
|
|
$router->post('image', '\catchAdmin\system\controller\Upload@image');
|
|
|
|
$router->post('file', '\catchAdmin\system\controller\Upload@file');
|
|
|
|
})->middleware(\catcher\middlewares\JsonResponseMiddleware::class);
|
2020-04-29 17:37:45 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 附件
|
|
|
|
$router->resource('attachments', '\catchAdmin\system\controller\Attachments');
|
2020-04-29 17:37:45 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 配置
|
|
|
|
$router->get('config/parent', '\catchAdmin\system\controller\Config@parent');
|
|
|
|
$router->resource('config', '\catchAdmin\system\controller\Config');
|
2020-04-29 17:37:45 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 代码生成
|
|
|
|
$router->post('generate', '\catchAdmin\system\controller\Generate@save');
|
|
|
|
$router->post('generate/preview', '\catchAdmin\system\controller\Generate@preview'); // 预览
|
2020-11-14 18:24:33 +08:00
|
|
|
$router->post('generate/create/module', '\catchAdmin\system\controller\Generate@createModule'); // 创建模块
|
2020-06-17 14:29:31 +08:00
|
|
|
|
2020-06-24 09:10:01 +08:00
|
|
|
// 敏感词
|
|
|
|
$router->resource('sensitive/word', '\catchAdmin\system\controller\SensitiveWord');
|
2020-09-12 17:22:43 +08:00
|
|
|
|
|
|
|
//developer路由
|
|
|
|
$router->resource('developer', '\catchAdmin\system\controller\Developer')->middleware('auth');
|
|
|
|
// 开发者认证
|
|
|
|
$router->post('developer/authenticate', '\catchAdmin\system\controller\Developer@authenticate');
|
|
|
|
|
|
|
|
// 模块管理
|
|
|
|
$router->get('modules', '\catchAdmin\system\controller\Module@index');
|
|
|
|
$router->put('modules/<module>', '\catchAdmin\system\controller\Module@disOrEnable');
|
2020-09-22 11:14:51 +08:00
|
|
|
$router->put('cache/modules', '\catchAdmin\system\controller\Module@cache');
|
|
|
|
$router->delete('clear/modules', '\catchAdmin\system\controller\Module@clear');
|
2021-04-24 20:32:36 +08:00
|
|
|
|
|
|
|
// excel 导入&导出通用
|
|
|
|
$router->post('excel/export', '\catchAdmin\system\controller\Excel@export');
|
|
|
|
$router->post('excel/import', '\catchAdmin\system\controller\Excel@import');
|
|
|
|
|
2020-07-13 15:28:38 +08:00
|
|
|
})->middleware('auth');
|
|
|
|
|
2021-03-31 20:21:39 +08:00
|
|
|
// 获取 table
|
|
|
|
$router->get('table/<module>/<tableClass>', function ($module, $tableClass){
|
2021-04-01 20:17:25 +08:00
|
|
|
$table = sprintf('\\catchAdmin\\%s\\tables\\%s', $module, ucfirst($tableClass));
|
2021-03-31 20:21:39 +08:00
|
|
|
|
|
|
|
return (new $table)->render(request()->param('only'));
|
|
|
|
});
|
|
|
|
|
2020-09-12 17:22:43 +08:00
|
|
|
|