Files
sentos/route/app.php
2022-05-24 16:10:50 +08:00

26 lines
1.1 KiB
PHP

<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::rule('/', function(){
if(request()->isAjax()){
return ['code' => 1, 'data' => 'SentOS'];
}else{
return view('index');
}
});
Route::group('/', function(){
Route::rule('system/:controller/:action', 'system.:controller/:action');
Route::rule('auth/user/:action', 'auth.User/:action');
Route::rule('auth/department/:action', 'auth.Department/:action');
Route::rule('auth/role/:action', 'auth.Role/:action');
})->middleware([\app\middleware\Check::class], 'api');