TaoLer/app/index/route/route.php

46 lines
1.5 KiB
PHP
Raw Normal View History

2020-01-01 13:17:19 +08:00
<?php
/*
* @Author: TaoLer <alipey_tao@qq.com>
* @Date: 2021-12-06 16:04:50
2022-08-02 18:47:24 +08:00
* @LastEditTime: 2022-04-22 16:25:14
* @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
//详情页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'); // 首页访问路由
Route::group(function () use($detail_as,$cate_as){
2022-08-02 18:46:05 +08:00
Route::get("$detail_as<id>", 'article/detail');
2022-08-02 18:47:24 +08:00
Route::get("$cate_as<ename>$",'article/cate')->name('cate');
2022-08-02 18:46:05 +08:00
Route::get("$cate_as<ename>/<type>$", 'article/cate')->name('cate_type');
Route::rule("$cate_as<ename>/<type>/<page>", 'article/cate')->name('cate_page');
Route::rule('add','Article/add');
2022-04-17 17:09:19 +08:00
Route::rule('tags','Article/tags')->allowCrossDomain();
Route::rule('edit/[:id]','Article/edit');
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');
2022-08-02 18:46:05 +08:00
Route::rule('reg$','Login/reg')
2020-01-01 13:17:19 +08:00
->middleware(\app\middleware\CheckRegister::class);
Route::rule('search/[:keywords]', 'index/search'); // 搜索
2020-01-01 13:17:19 +08:00