Files
sentcms/route/app.php
2020-02-18 10:21:17 +08:00

48 lines
2.0 KiB
PHP
Executable File

<?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('/', 'Front/index');
Route::rule('search', 'Front/search');
Route::rule('lists', 'Front/lists');
Route::rule('detail-:id', 'Front/detail');
Route::rule('category', 'Front/category');
Route::rule('topic-:id', 'Front/topic');
Route::rule('front/:function', 'Front/:function');
Route::group('admin', function () {
Route::rule('/', 'admin.Index/index');
Route::rule('login', 'admin.Index/login');
Route::rule('logout', 'admin.Index/logout');
Route::rule(':controller/:function', 'admin.:controller/:function');
});
Route::group('user', function () {
Route::rule('/', 'admin.Index/index');
Route::rule('login', 'user.Index/login');
Route::rule('logout', 'user.Index/logout');
Route::rule('register', 'user.Index/register');
Route::rule(':controller/:function', 'user.:controller/:function');
});
Route::group('api', function () {
Route::rule('/', 'api.Index/index');
Route::rule('login', 'api.Login/index');
Route::rule('register', 'api.Login/register');
Route::rule('logout', 'api.Login/logout');
Route::rule(':controller/:function', 'api.:controller/:function');
})->allowCrossDomain([
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Credentials' => 'true',
'Access-Control-Allow-Headers' => 'authorization, token, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With',
]);
Route::miss('Index/miss');