作者 邓超

v2

@@ -71,6 +71,23 @@ class Index extends Base @@ -71,6 +71,23 @@ class Index extends Base
71 71
72 72
73 73
  74 + /**
  75 + * 单页
  76 + * @param $key
  77 + * @author:dc
  78 + * @time 2022/12/28 16:59
  79 + */
  80 + public function page($key){
  81 + $page = $this->getData('page',['urlkey'=>$key]);
  82 + if(!$page){
  83 + return redirect('/');
  84 + }
  85 +
  86 + return response($page,200,['Content-Type'=>'text/html charset=urt-8;']);
  87 + }
  88 +
  89 +
  90 +
74 91
75 92
76 } 93 }
@@ -65,6 +65,6 @@ Route::get('/blogs', [\App\Http\Controllers\V2\Index::class,'blog']); @@ -65,6 +65,6 @@ Route::get('/blogs', [\App\Http\Controllers\V2\Index::class,'blog']);
65 // 博客详情 65 // 博客详情
66 Route::get('/blog/{id}', [\App\Http\Controllers\V2\Index::class,'blog_info'])->where('id','\d+'); 66 Route::get('/blog/{id}', [\App\Http\Controllers\V2\Index::class,'blog_info'])->where('id','\d+');
67 // 单页 67 // 单页
68 -Route::get('/page/{id}', [\App\Http\Controllers\V2\Index::class,'page'])->where('id','\d+'); 68 +Route::get('/page/{key}', [\App\Http\Controllers\V2\Index::class,'page'])->where('key','[a-z_\-\d]{2,}');
69 69
70 70