web.php
3.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
// TODO::这个是第一版 的路由,暂时不要删除,可能会临时想起了恢复看下
// 多语言
//$px = explode('/',trim($_SERVER['PATH_INFO']??'','/').'/')[0];
//if (empty(\App\Fun::lang()[$px])){
// $px = '';
//}
//
//define('THE_LANG',$px ? : 'en');
//
//Route::prefix($px)->group(function (){
// // 首页
// Route::get('/', [\App\Http\Controllers\Index::class,'home']);
//// Route::get('/index.html', [\App\Http\Controllers\Index::class,'home']);
//
//// 关于我们
// Route::get('about-us', [\App\Http\Controllers\Index::class,'about']);
//// Route::get('about-us.html', [\App\Http\Controllers\Index::class,'about']);
//// Route::get('about-us/index.html', [\App\Http\Controllers\Index::class,'about']);
//
////博客
// Route::get('blog', [\App\Http\Controllers\Index::class,'blog'])->name('blog');
//// Route::get('blog.html', [\App\Http\Controllers\Index::class,'blog'])->name('blog');
// Route::get('blog/{id}', [\App\Http\Controllers\Index::class,'blog_info'])->name('blog.info')->where('id','\d+');
//// Route::get('blog/{id}.html', [\App\Http\Controllers\Index::class,'blog_info'])->name('blog.info')->where('id','\d+');
//
////
// Route::get('kol-solution', [\App\Http\Controllers\Index::class,'kolSolution']);
//// Route::get('kol-solution.html', [\App\Http\Controllers\Index::class,'kolSolution']);
//
////
// Route::get('faq', [\App\Http\Controllers\Index::class,'fqa']);
//// Route::get('faq.html', [\App\Http\Controllers\Index::class,'fqa']);
//
//
// Route::get('shop', [\App\Http\Controllers\Index::class,'shop']);
//// Route::get('shop.html', [\App\Http\Controllers\Index::class,'shop']);
//
// Route::get('shopk-app', [\App\Http\Controllers\Index::class,'shopApp']);
//// Route::get('shopk-app.html', [\App\Http\Controllers\Index::class,'shopApp']);
//
//});
/***************************** end first ***********************************/
/**
* 第二版暂时没有多语言功能
*/
Route::get('/', [\App\Http\Controllers\V2\Index::class,'home']);
// 博客列表
Route::get('/blog', [\App\Http\Controllers\V2\Index::class,'blog']);
// 博客详情
Route::get('/blog/{id}', [\App\Http\Controllers\V2\Index::class,'blog_info'])->where('id','\d+');
// 单页
Route::get('/page/{key}', [\App\Http\Controllers\V2\Index::class,'page'])->where('key','[a-z_\-\d]{2,}');
// 跳转页面
Route::get('/redirect', [\App\Http\Controllers\Controller::class,'redirect']);
// 单页的另一种方式 这个是通用的匹配
Route::get('/{key}', [\App\Http\Controllers\V2\Index::class,'page'])->where('key','[a-z_\-\d]{2,}');