123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222 |
- <?php
- /**
- * @Created by PhpStorm
- * @author: Kirin
- * @day: 2024/11/19
- * @time: 11:16
- */
- use app\http\middleware\admin\AdminAuthTokenMiddleware;
- use app\http\middleware\admin\AdminCheckRoleMiddleware;
- use app\http\middleware\admin\AdminLogMiddleware;
- use app\http\middleware\AllowOriginMiddleware;
- use app\http\middleware\StationOpenMiddleware;
- use think\facade\Route;
- Route::group('adminapi', function () {
- //无需登录
- Route::group(function () {
- //图形验证码
- Route::get('ajcaptcha', 'Login/ajcaptcha')->name('ajcaptcha');
- //图形验证码
- Route::post('ajcheck', 'Login/ajcheck')->name('ajcheck');
- //是否需要滑块验证接口
- Route::post('is_captcha', 'Login/getAjCaptcha')->name('getAjCaptcha');
- //验证码
- Route::get('captcha_pro', 'Login/captcha')->name('')->option(['real_name' => '获取验证码']);
- //用户名密码登录
- Route::post('login', 'Login/login')->name('AdminLogin')->option(['real_name' => '用户名密码登录']);
- //后台登录页面数据
- Route::get('login/info', 'Login/info')->option(['real_name' => '登录信息']);
- //管理员退出登陆
- Route::get('logout', 'Login/logout')->name('SystemAdminLogout')->option(['real_name' => '退出登陆']);
- });
- Route::group(function () {
- //需登录,但不需要权限
- Route::group(function () {
- Route::get('info', 'Common/adminInfo')->option(['real_name' => '获取后台用户信息']);
- //获取搜索菜单列表
- Route::get('menusList', 'Common/menusList')->option(['real_name' => '搜索菜单列表']);
- //获取logo
- Route::get('logo', 'Common/getLogo')->option(['real_name' => '获取logo']);
- //获取城市数据
- Route::get('city', 'Common/city')->option(['real_name' => '获取城市数据']);
- });
- //需登录,也需要权限
- Route::group(function () {
- //用户管理
- Route::group('user', function () {
- Route::get('typeHeader', 'user.User/typeHeader')->option(['real_name' => '获取用户类型头部数据']);
- Route::get('detail/:type/:id', 'user.User/oneUserInfo')->option(['real_name' => '获取单个用户信息']);
- Route::post('giveLevel/:uid', 'user.User/give_level')->option(['real_name' => '赠送等级']);
- Route::delete('delLevel/:uid', 'user.User/del_level')->option(['real_name' => '清除等级']);
- Route::put('setGroup', 'user.User/set_group')->option(['real_name' => '设置分组']);
- Route::put('updateAccount/:uid', 'user.User/updateAccount')->option(['real_name' => '编辑用户账户']);
- Route::put('set_status/:id/:status', 'user.User/set_status')->option(['real_name' => '编辑用户状态']);
- });
- //财务管理
- Route::group('finance', function () {
- });
- Route::group('log', function () {
- Route::get('', 'system.SystemLogs/index')->option(['real_name' => '系统日志列表']);
- Route::get('/:id', 'system.SystemLogs/detail')->option(['real_name' => '系统日志详情']);
- });
- Route::group('menus', function () {
- //修改权限规格显示状态
- Route::put('show/:id', 'system.SystemMenus/show')->name('SystemMenusShow')->option(['real_name' => '修改权限规格显示状态']);
- //未添加的权限规则列表
- Route::get('ruleList', 'system.SystemMenus/ruleList')->option(['real_name' => '未添加的权限规则列表']);
- });
- //修改管理员身份状态
- Route::put('roles/set_status/:id/:status', 'system.SystemRoles/setStatus')->option(['real_name' => '修改管理员身份状态']);
- //修改管理员状态
- Route::put('admins/set_status/:id/:status', 'system.SystemAdmins/setStatus')->option(['real_name' => '修改管理员状态']);
- //修改当前管理员信息
- Route::put('update_admin', 'system.SystemAdmins/update_admin')->name('SystemAdminUpdateAdmin')->option(['real_name' => '修改当前管理员信息']);
- //修改配置分类状态
- Route::put('config_class/set_status/:id/:status', 'system.config.SystemConfigTab/setStatus')->option(['real_name' => '修改配置分类状态']);
- //获取配置分类树状表
- Route::get('config_class/select', 'system.config.SystemConfigTab/getSelectForm')->option(['real_name' => '获取配置分类树状表']);
- //基本配置编辑头部数据
- Route::get('config/header_basics', 'system.config.SystemConfig/header_basics')->option(['real_name' => '基本配置编辑头部数据']);
- //获取配置数据
- Route::get('config/read/:id', 'system.config.SystemConfig/readConfig')->option(['real_name' => '获取配置数据']);
- //积分配置保存数据
- Route::post('config/save', 'system.config.SystemConfig/saveConfig')->option(['real_name' => '积分配置保存数据']);
- //修改配置状态
- Route::put('config/set_status/:id/:status', 'v1.system.config.SystemConfig/setStatus')->option(['real_name' => '修改配置状态']);
- //用户等级关闭/启用
- Route::put('user_level/set_status/:id/:status', 'system.config.SystemUserLevel/setStatus')->option(['real_name' => '用户等级关闭/启用']);
- //用户等级快速修改
- Route::put('user_level/set_value', 'system.config.SystemUserLevel/setValue')->option(['real_name' => '用户等级快速修改']);
- //等级任务模板
- Route::get('user_level/task_base', 'system.config.SystemUserLevel/getTaskBase')->option(['real_name' => '等级任务模板']);
- //附件管理
- Route::group('file', function () {
- //图片附件列表
- Route::get('', 'system.attachment.SystemAttachment/index')->option(['real_name' => '图片附件列表']);
- //删除图片
- Route::post('delete', 'system.attachment.SystemAttachment/batchDelete')->option(['real_name' => '删除图片']);
- //移动图片分类
- Route::put('move', 'system.attachment.SystemAttachment/moveImageCate')->option(['real_name' => '移动图片分类']);
- //修改图片名称
- Route::put('update/:id', 'system.attachment.SystemAttachment/update')->option(['real_name' => '修改图片名称']);
- //上传图片
- Route::post('upload/[:upload_type]', 'system.attachment.SystemAttachment/upload')->option(['real_name' => '上传图片']);
- //获取上传key
- Route::get('temp_key', 'system.attachment.SystemAttachment/getTempKeys')->option(['real_name' => '获取上传key']);
- //分片上传本地视频
- Route::post('video_upload', 'system.attachment.SystemAttachment/videoUpload')->option(['real_name' => '分片上传本地视频']);
- //oss视频素材保存
- Route::post('video_attachment', 'system.attachment.SystemAttachment/saveVideoAttachment')->option(['real_name' => '视频素材保存']);
- //网络图片上传
- Route::post('online/upload', 'system.attachment.SystemAttachment/onlineUpload')->option(['real_name' => '网络图片上传']);
- //附件分类管理资源路由
- Route::resource('category', 'system.attachment.SystemAttachmentCategory')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '获取附件分类列表',
- 'read' => '获取附件分类详情',
- 'save' => '保存附件分类',
- 'update' => '修改附件分类',
- 'delete' => '删除附件分类'
- ]]);
- });
- //清除数据
- Route::post('clear_data/:type', 'system.SystemClearData/clear')->option(['real_name' => '清除数据']);
- //替换域名
- Route::post('replace_site_url', 'system.SystemClearData/replaceSiteUrl')->option(['real_name' => '替换域名']);
- //短信发送记录
- Route::get('sms_record', 'system.SmsRecord/index')->option(['real_name' => '短信发送记录']);
- //用户分组资源路由
- Route::resource('user', 'user.User')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '用户列表',
- 'read' => '用户详情',
- 'save' => '保存用户',
- 'update' => '修改用户',
- 'delete' => '注销用户'
- ]]);
- //用户分组资源路由
- Route::resource('user_group', 'user.UserGroup')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '用户分组列表',
- 'read' => '用户分组详情',
- 'save' => '保存用户分组',
- 'update' => '修改用户分组',
- 'delete' => '删除用户分组'
- ]]);
- //用户分组资源路由
- Route::resource('user_level', 'system.config.SystemUserLevel')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '用户等级列表',
- 'read' => '用户等级详情',
- 'save' => '保存等级分组',
- 'update' => '修改等级分组',
- 'delete' => '删除等级分组'
- ]]);
- //权限菜单资源路由
- Route::resource('menus', 'system.SystemMenus')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '获取权限菜单列表',
- 'read' => '获取权限菜单详情',
- 'save' => '保存权限菜单',
- 'update' => '修改权限菜单',
- 'delete' => '删除权限菜单'
- ]]);
- //身份资源路由
- Route::resource('roles', 'system.SystemRoles')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '获取身份列表',
- 'read' => '获取身份详情',
- 'save' => '保存身份',
- 'update' => '修改身份',
- 'delete' => '删除身份'
- ]]);
- //管理员资源路由
- Route::resource('admins', 'system.SystemAdmins')
- ->only(['index', 'read', 'save', 'update', 'delete'])
- ->option(['real_name' => [
- 'index' => '获取管理员列表',
- 'read' => '获取管理员详情',
- 'save' => '保存管理员',
- 'update' => '修改管理员',
- 'delete' => '删除管理员'
- ]]);
- //系统配置分类资源路由
- Route::resource('config_class', 'system.config.SystemConfigTab')
- ->only(['index', 'read', 'save', 'update', 'delete'])->option(['real_name' => [
- 'index' => '获取系统配置分类列表',
- 'read' => '获取系统配置分类详情',
- 'save' => '保存系统配置分类',
- 'update' => '修改系统配置分类',
- 'delete' => '删除系统配置分类'
- ]]);
- //系统配置资源路由
- Route::resource('config', 'system.config.SystemConfig')
- ->only(['index', 'read', 'save', 'update', 'delete'])->option(['real_name' => [
- 'index' => '获取系统配置列表',
- 'read' => '获取系统配置详情',
- 'save' => '保存系统配置',
- 'update' => '修改系统配置',
- 'delete' => '删除系统配置'
- ]]);
- })->middleware(AdminCheckRoleMiddleware::class);
- })->middleware(AdminAuthTokenMiddleware::class)->middleware(AdminLogMiddleware::class);
- })->prefix('admin.')->middleware(AllowOriginMiddleware::class);
|