2020-01-01 13:17:19 +08:00
|
|
|
<?php
|
2022-04-19 17:26:10 +08:00
|
|
|
/*
|
|
|
|
* @Author: TaoLer <alipey_tao@qq.com>
|
|
|
|
* @Date: 2021-12-06 16:04:50
|
|
|
|
* @LastEditTime: 2022-04-19 13:19:28
|
|
|
|
* @LastEditors: TaoLer
|
|
|
|
* @Description: 搜索引擎SEO优化设置
|
|
|
|
* @FilePath: \TaoLer\app\index\route\route.php
|
|
|
|
* Copyright (c) 2020~2022 http://www.aieok.com All rights reserved.
|
|
|
|
*/
|
2020-01-01 13:17:19 +08:00
|
|
|
use think\facade\Route;
|
2020-04-22 18:37:53 +08:00
|
|
|
|
2022-04-19 17:26:10 +08:00
|
|
|
//详情页URL别称
|
|
|
|
$detail_as = config('taoler.url_rewrite.article_as');
|
|
|
|
//分类别称
|
|
|
|
$cate_as = config('taoler.url_rewrite.cate_as');
|
|
|
|
|
2020-04-22 18:37:53 +08:00
|
|
|
Route::get('captcha/[:config]','\\think\\captcha\\CaptchaController@index');
|
2020-01-01 13:17:19 +08:00
|
|
|
Route::rule('/', 'index'); // 首页访问路由
|
2022-04-19 17:26:10 +08:00
|
|
|
Route::group(function () use($detail_as,$cate_as){
|
|
|
|
Route::get($detail_as .'/:id', 'article/detail');
|
|
|
|
Route::get($cate_as.'/<ename>$','article/cate');
|
|
|
|
Route::get($cate_as.'/<ename>/<type>$', 'article/cate')->name('cate_type');
|
|
|
|
Route::rule($cate_as.'/<ename>/<type>/<page>', 'article/cate')->name('cate_page');
|
2021-08-07 16:29:38 +08:00
|
|
|
Route::rule('add','Article/add');
|
2022-04-17 17:09:19 +08:00
|
|
|
Route::rule('tags','Article/tags')->allowCrossDomain();
|
2021-08-07 16:29:38 +08:00
|
|
|
Route::rule('edit/[:id]','Article/edit');
|
2020-01-09 18:03:33 +08:00
|
|
|
//Route::rule('del/:id','article/delete');
|
2022-01-07 14:45:35 +08:00
|
|
|
})->pattern([
|
|
|
|
'ename' => '\w+',
|
|
|
|
'type' => '\w+',
|
|
|
|
'page' => '\d+',
|
|
|
|
'id' => '\d+',
|
|
|
|
]);
|
|
|
|
|
2020-01-01 13:17:19 +08:00
|
|
|
Route::group(function () {
|
|
|
|
Route::rule('u/:id', 'user/home');
|
|
|
|
});
|
|
|
|
Route::rule('login','login/index');
|
2020-01-17 14:57:05 +08:00
|
|
|
Route::rule('forget','login/forget');
|
|
|
|
Route::rule('postcode','login/postcode');
|
|
|
|
Route::rule('respass','login/respass');
|
2020-01-01 13:17:19 +08:00
|
|
|
Route::rule('reg','Login/reg')
|
|
|
|
->middleware(\app\middleware\CheckRegister::class);
|
2020-05-21 16:58:06 +08:00
|
|
|
|
|
|
|
Route::rule('search/[:keywords]', 'index/search'); // 搜索
|
2020-01-01 13:17:19 +08:00
|
|
|
|