From 383a4194b3e1d9cb608724c7cfeb153e12ed54a0 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:07:02 +0800 Subject: [PATCH 01/42] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E5=AD=97?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E7=9A=84=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C=EF=BC=88=E4=B8=8A=E4=B8=8B=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/home/main.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 71d2342..9ddd853 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -11,7 +11,7 @@
-- Gitee From 37079d9893cf0584bc51d2b27a568d22915eceb6 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:13:25 +0800 Subject: [PATCH 02/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/article.blade.php | 1 + resources/views/article/footer.blade.php | 13 +++++++++++++ resources/views/article/header.blade.php | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 resources/views/article/footer.blade.php diff --git a/resources/views/article.blade.php b/resources/views/article.blade.php index 014405c..d5ae2ef 100644 --- a/resources/views/article.blade.php +++ b/resources/views/article.blade.php @@ -13,6 +13,7 @@ {{-- 主体 --}}
@include('article.main') + @include('article.footer')
{{-- 尾部 --}} diff --git a/resources/views/article/footer.blade.php b/resources/views/article/footer.blade.php new file mode 100644 index 0000000..57ec5ae --- /dev/null +++ b/resources/views/article/footer.blade.php @@ -0,0 +1,13 @@ +{{-- resources\views\article\header.blade.php --}} +
+ {{-- ... --}} +
+
+
\ No newline at end of file diff --git a/resources/views/article/header.blade.php b/resources/views/article/header.blade.php index f2a2dab..d911790 100644 --- a/resources/views/article/header.blade.php +++ b/resources/views/article/header.blade.php @@ -1,6 +1,6 @@ {{-- resources\views\article\header.blade.php --}}
-
+ height: 400px; + border: 0px; + margin-top: 100px;"> {{-- ... --}}
-- Gitee From 9960d84bb12dd05708e7985627213a5e5e7e0702 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:28:52 +0800 Subject: [PATCH 04/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8C=BA< {{-- ... --}} -
+
+
+
+
+

内容

+
+ + From. Who + +
+
+
+
\ No newline at end of file -- Gitee From eaeac5733f72d849ad320d10b379781bb74eafad Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:35:03 +0800 Subject: [PATCH 05/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8C=BA< --}}
-
+

内容

-
+
From. Who diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 931279d..0b5e73a 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -1,5 +1,5 @@ {{-- resources\views\article\main.blade.php --}} -{{-- @dump($article) --}} +@dump($article) @include('custom.phpFunction') @php // 设置时区 -- Gitee From 2f2ec52ce658c1ff863fa5bae9dddb3718031eef Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:37:25 +0800 Subject: [PATCH 06/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E8=AF=84=E8=AE=BA=E5=8C=BA<<=E6=90=81=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/article.blade.php | 2 +- resources/views/article/main.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/article.blade.php b/resources/views/article.blade.php index d5ae2ef..105608b 100644 --- a/resources/views/article.blade.php +++ b/resources/views/article.blade.php @@ -13,7 +13,7 @@ {{-- 主体 --}}
@include('article.main') - @include('article.footer') + {{-- @include('article.footer') --}}
{{-- 尾部 --}} diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 0b5e73a..931279d 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -1,5 +1,5 @@ {{-- resources\views\article\main.blade.php --}} -@dump($article) +{{-- @dump($article) --}} @include('custom.phpFunction') @php // 设置时区 -- Gitee From 125d5b8b19e6fed5726081d5f0696b2a4daa878e Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:43:17 +0800 Subject: [PATCH 07/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 17 +++++++++++++++++ resources/views/api.blade.php | 5 +++++ 2 files changed, 22 insertions(+) create mode 100644 resources/views/api.blade.php diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 35bd57c..e97d91f 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -225,4 +225,21 @@ class ArticleController extends Controller // return response('未开发该功能')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } + + // 博客检索api + public function searchAPI() + { + $where = $_GET['q']; + $articles = Article::where('aid', 'like', "%$where%") + ->orWhere('title', 'like', "%$where%") + ->orWhere('title2', 'like', "%$where%") + ->orWhere('content', 'like', "%$where%") + ->get(); + + return view('api', ['articles'=>$articles, 'msg'=>'Search: '.$where]); + + // return response(dump($articles)); + + // return response('未开发该功能')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); + } } \ No newline at end of file diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php new file mode 100644 index 0000000..c7c95cb --- /dev/null +++ b/resources/views/api.blade.php @@ -0,0 +1,5 @@ +{{-- resources\views\home.blade.php --}} +@php + header('content-type:text/plain;charset=utf-8'); +@endphp +@dump($articles) \ No newline at end of file -- Gitee From 2cf43d25886c12e84daa539eb733394797563999 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:47:34 +0800 Subject: [PATCH 08/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 2 +- routes/web.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index e97d91f..390d5ce 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -236,7 +236,7 @@ class ArticleController extends Controller ->orWhere('content', 'like', "%$where%") ->get(); - return view('api', ['articles'=>$articles, 'msg'=>'Search: '.$where]); + return view('api', ['articles'=>$articles, 'msg'=>$where]); // return response(dump($articles)); diff --git a/routes/web.php b/routes/web.php index a191e49..a61289f 100644 --- a/routes/web.php +++ b/routes/web.php @@ -54,6 +54,11 @@ Route::get('test', function () { }); +//api +// 文章Search搜索 +Route::get('api/search', [ArticleController::class, 'searchAPI'])->name('search'); + + // 404 // 指定异常时的路由 Route::fallback(function () { -- Gitee From cf0ee7df69742b3f0cd89c8f2b01ff0d745c8944 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:52:16 +0800 Subject: [PATCH 09/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api.blade.php | 39 ++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php index c7c95cb..bebd546 100644 --- a/resources/views/api.blade.php +++ b/resources/views/api.blade.php @@ -2,4 +2,41 @@ @php header('content-type:text/plain;charset=utf-8'); @endphp -@dump($articles) \ No newline at end of file +{{-- @dump($articles) --}} +@include('custom.phpFunction') + @foreach ($articles as $article) + @php + // 设置时区 + date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); + @endphp +@dump($articles) + + {{--
+
+
+ + + +
+
+
+
{{ cut_str($article->title, 12, '…') }}
+
+ @php + if ($article->title2 != null) + echo cut_str($article->title2, 16, '…'); + @endphp + + {{-- {{ cut_str($article->title2, 16, '…') }} --}} + {{--
+

+ {{ cut_str($article->content, 16, '') }} + +

+

最后修改于:{{ date("Y-m-d H:i",$article->lastdate) }}

+
+
+
+
--}} + + @endforeach \ No newline at end of file -- Gitee From e308256cea169672ac3855e07456a4626a4fb05e Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:57:20 +0800 Subject: [PATCH 10/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api.blade.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php index bebd546..b38df62 100644 --- a/resources/views/api.blade.php +++ b/resources/views/api.blade.php @@ -8,8 +8,17 @@ @php // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); + echo '{'; + echo 'aid:' + $article->aid; + echo 'img:' + $article->img; + echo 'title:' + $article->title; + echo 'txt:' + $article->content; + echo 'date:' + date("Y-m-d H:i",$article->lastdate); + echo '}'; @endphp -@dump($articles) +@dump($article) + + {{--
-- Gitee From f7d26578c3a3037a0fa29c3a08a900b9d34ce431 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:58:16 +0800 Subject: [PATCH 11/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api.blade.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php index b38df62..9b3f3fb 100644 --- a/resources/views/api.blade.php +++ b/resources/views/api.blade.php @@ -9,11 +9,11 @@ // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); echo '{'; - echo 'aid:' + $article->aid; - echo 'img:' + $article->img; - echo 'title:' + $article->title; - echo 'txt:' + $article->content; - echo 'date:' + date("Y-m-d H:i",$article->lastdate); + echo 'aid:' . $article->aid; + echo 'img:' . $article->img; + echo 'title:' . $article->title; + echo 'txt:' . $article->content; + echo 'date:' . date("Y-m-d H:i",$article->lastdate); echo '}'; @endphp @dump($article) -- Gitee From 0177c7fe2bef02cb383f902365beb26337030288 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Fri, 12 May 2023 23:59:38 +0800 Subject: [PATCH 12/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api.blade.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php index 9b3f3fb..cd68af6 100644 --- a/resources/views/api.blade.php +++ b/resources/views/api.blade.php @@ -9,16 +9,13 @@ // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); echo '{'; - echo 'aid:' . $article->aid; - echo 'img:' . $article->img; - echo 'title:' . $article->title; - echo 'txt:' . $article->content; + echo 'aid:' . $article->aid . ','; + echo 'img:' . $article->img. ','; + echo 'title:' . $article->title. ','; + echo 'txt:' . $article->content. ','; echo 'date:' . date("Y-m-d H:i",$article->lastdate); echo '}'; @endphp -@dump($article) - - {{--
-- Gitee From 8eb58383dcc71804469cb430f8e433f01154a3a3 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:02:00 +0800 Subject: [PATCH 13/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api.blade.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/views/api.blade.php b/resources/views/api.blade.php index cd68af6..9337226 100644 --- a/resources/views/api.blade.php +++ b/resources/views/api.blade.php @@ -8,13 +8,14 @@ @php // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); - echo '{'; - echo 'aid:' . $article->aid . ','; - echo 'img:' . $article->img. ','; - echo 'title:' . $article->title. ','; - echo 'txt:' . $article->content. ','; - echo 'date:' . date("Y-m-d H:i",$article->lastdate); - echo '}'; + echo json_encode($article); + // echo '{'; + // echo 'aid:' . $article->aid . ','; + // echo 'img:' . $article->img. ','; + // echo 'title:' . $article->title. ','; + // echo 'txt:' . $article->content. ','; + // echo 'date:' . date("Y-m-d H:i",$article->lastdate); + // echo '}'; @endphp {{--
-- Gitee From b39f078632a90276cf9b895ddf11c30e20099cb2 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:04:20 +0800 Subject: [PATCH 14/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 2 +- resources/views/{api.blade.php => api/search.blade.php} | 0 routes/web.php | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename resources/views/{api.blade.php => api/search.blade.php} (100%) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 390d5ce..dd5f398 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -236,7 +236,7 @@ class ArticleController extends Controller ->orWhere('content', 'like', "%$where%") ->get(); - return view('api', ['articles'=>$articles, 'msg'=>$where]); + return view('api.search', ['articles'=>$articles, 'msg'=>$where]); // return response(dump($articles)); diff --git a/resources/views/api.blade.php b/resources/views/api/search.blade.php similarity index 100% rename from resources/views/api.blade.php rename to resources/views/api/search.blade.php diff --git a/routes/web.php b/routes/web.php index a61289f..001f3ac 100644 --- a/routes/web.php +++ b/routes/web.php @@ -56,7 +56,7 @@ Route::get('test', function () { //api // 文章Search搜索 -Route::get('api/search', [ArticleController::class, 'searchAPI'])->name('search'); +Route::get('api/search', [ArticleController::class, 'searchAPI'])->name('searchapi'); // 404 -- Gitee From 15cd86f8de4838db462b43cd4c8c6c144d5ddf92 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:11:32 +0800 Subject: [PATCH 15/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 14 ++++++++++++++ resources/views/api/article.blade.php | 11 +++++++++++ resources/views/api/search.blade.php | 8 ++++---- routes/web.php | 2 ++ 4 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 resources/views/api/article.blade.php diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index dd5f398..7387651 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -242,4 +242,18 @@ class ArticleController extends Controller // return response('未开发该功能')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } + // 单独文章页api + public function articleAPI($id = 'new') + { + if ($id == 'new'){ + $article = DB::table('article')->orderBy('aid', 'desc')->first(); + // $article = DB::table('article')->where('aid', $new->aid)->get(); + $title = '最新文章'; + $id = $article->aid; + }else{ + $article = DB::table('article')->where('aid', $id)->first(); + } + + return view('api.article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); + } } \ No newline at end of file diff --git a/resources/views/api/article.blade.php b/resources/views/api/article.blade.php new file mode 100644 index 0000000..fe3d2ed --- /dev/null +++ b/resources/views/api/article.blade.php @@ -0,0 +1,11 @@ +{{-- resources\views\api\article.blade.php --}} +@php + header('content-type:text/plain;charset=utf-8'); + // 设置时区 + date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); +@endphp +{{-- @dump($articles) --}} +@include('custom.phpFunction') + @php + echo json_encode($article); + @endphp diff --git a/resources/views/api/search.blade.php b/resources/views/api/search.blade.php index 9337226..e6ee81e 100644 --- a/resources/views/api/search.blade.php +++ b/resources/views/api/search.blade.php @@ -1,14 +1,14 @@ -{{-- resources\views\home.blade.php --}} +{{-- resources\views\api\article.blade.php --}} @php header('content-type:text/plain;charset=utf-8'); + // 设置时区 + date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); @endphp {{-- @dump($articles) --}} @include('custom.phpFunction') @foreach ($articles as $article) @php - // 设置时区 - date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); - echo json_encode($article); + echo json_encode($article);//todo 需要修改 // echo '{'; // echo 'aid:' . $article->aid . ','; // echo 'img:' . $article->img. ','; diff --git a/routes/web.php b/routes/web.php index 001f3ac..ebc3475 100644 --- a/routes/web.php +++ b/routes/web.php @@ -57,6 +57,8 @@ Route::get('test', function () { //api // 文章Search搜索 Route::get('api/search', [ArticleController::class, 'searchAPI'])->name('searchapi'); +// 文章内容页 +Route::get('api/article/{id?}', [ArticleController::class, 'articleAPI'])->name('articleapi'); // 404 -- Gitee From e6596a8112a38ac5edf1e813b7eccf8ab852c1f8 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:13:38 +0800 Subject: [PATCH 16/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api<=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E4=BF=AE=E6=94=B9=3F=E6=88=96=E8=AE=B8=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api/search.blade.php | 39 ++-------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/resources/views/api/search.blade.php b/resources/views/api/search.blade.php index e6ee81e..7825a1d 100644 --- a/resources/views/api/search.blade.php +++ b/resources/views/api/search.blade.php @@ -8,42 +8,7 @@ @include('custom.phpFunction') @foreach ($articles as $article) @php - echo json_encode($article);//todo 需要修改 - // echo '{'; - // echo 'aid:' . $article->aid . ','; - // echo 'img:' . $article->img. ','; - // echo 'title:' . $article->title. ','; - // echo 'txt:' . $article->content. ','; - // echo 'date:' . date("Y-m-d H:i",$article->lastdate); - // echo '}'; + echo json_encode($article).',';//todo 需要修改?或许会出现问题 + echo json_encode($article).',';//todo 需要修改?或许会出现问题 @endphp - - {{--
-
-
- - - -
-
-
-
{{ cut_str($article->title, 12, '…') }}
-
- @php - if ($article->title2 != null) - echo cut_str($article->title2, 16, '…'); - @endphp - - {{-- {{ cut_str($article->title2, 16, '…') }} --}} - {{--
-

- {{ cut_str($article->content, 16, '') }} - -

-

最后修改于:{{ date("Y-m-d H:i",$article->lastdate) }}

-
-
-
-
--}} - @endforeach \ No newline at end of file -- Gitee From b0f9ac78281390d8c0e358b0460f68a143cb0581 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:20:26 +0800 Subject: [PATCH 17/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/api/search.blade.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/views/api/search.blade.php b/resources/views/api/search.blade.php index 7825a1d..0dde08f 100644 --- a/resources/views/api/search.blade.php +++ b/resources/views/api/search.blade.php @@ -3,12 +3,13 @@ header('content-type:text/plain;charset=utf-8'); // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); + $articlesJSON = []; @endphp {{-- @dump($articles) --}} @include('custom.phpFunction') @foreach ($articles as $article) @php - echo json_encode($article).',';//todo 需要修改?或许会出现问题 - echo json_encode($article).',';//todo 需要修改?或许会出现问题 + array_push($articlesJSON,json_encode($article)); @endphp - @endforeach \ No newline at end of file + @endforeach + {{ json_encode($articlesJSON) }} \ No newline at end of file -- Gitee From 31e1ef43f2617acb855bae953f75ba708981ab0c Mon Sep 17 00:00:00 2001 From: IO0288 Date: Sat, 13 May 2023 00:23:52 +0800 Subject: [PATCH 18/42] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=AF=E4=BE=9B=E8=B0=83=E7=94=A8=E7=9A=84api=EF=BC=9A?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=B8=8E=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 68a778d..76dc232 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,12 @@ server { - [x] 日志世界线 - [x] Search - [ ] 直接将账号密码写入.env(?) +- [ ] [WIP] API + +### 拓展功能-[WIP] API +- [x] 搜索/api/search?q={q} +- [x] 文字内容/api/article/{$id} + ### 演示站点 https://blog2.iabu.xyz/ -- Gitee From e4e0ec05d537d82640eedf2b66c910b1196ea153 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 12 Dec 2023 01:31:01 +0000 Subject: [PATCH 19/42] update resources/views/home/main.blade.php. fix:display card-img Signed-off-by: IO0288 --- resources/views/home/main.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 9ddd853..51eb6b4 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -11,7 +11,7 @@
-- Gitee From 1fcdbe27b6ed494b611ffc9c7138c5e4b90f1aaf Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 22:37:45 +0800 Subject: [PATCH 20/42] fix:alter table_name --- app/Http/Controllers/ArticleController.php | 28 +++++++++++----------- app/Http/Controllers/userController.php | 6 ++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 7387651..6021ea2 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -16,12 +16,12 @@ class ArticleController extends Controller public function article($id = 'new') { if ($id == 'new'){ - $article = DB::table('article')->orderBy('aid', 'desc')->first(); - // $article = DB::table('article')->where('aid', $new->aid)->get(); + $article = DB::table('articles')->orderBy('aid', 'desc')->first(); + // $article = DB::table('articles')->where('aid', $new->aid)->get(); $title = '最新文章'; $id = $article->aid; }else{ - $article = DB::table('article')->where('aid', $id)->first(); + $article = DB::table('articles')->where('aid', $id)->first(); } return view('article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); @@ -29,7 +29,7 @@ class ArticleController extends Controller // 文章列表页(主页) public function articleList() { - $articles = DB::table('article')->get(); + $articles = DB::table('articles')->get(); return view('home', ['articles'=>$articles, 'title'=>'主页']); } @@ -43,7 +43,7 @@ class ArticleController extends Controller return response('你还没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - $articleList = DB::table('article')->get(); + $articleList = DB::table('articles')->get(); return view('admin.article', ['title'=>'文章管理', 'list'=>$articleList]); } @@ -58,7 +58,7 @@ class ArticleController extends Controller if ($id == null) { return response('错误的参数{id}')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - $delete = DB::table('article')->where('aid', $id)->delete(); + $delete = DB::table('articles')->where('aid', $id)->delete(); if ($delete != 0) { // 日志 DB::table('logs')->insert([ @@ -84,7 +84,7 @@ class ArticleController extends Controller return response('你还没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - // $article = DB::table('article')->where('aid', $id)->first(); + // $article = DB::table('articles')->where('aid', $id)->first(); return view('insert', ['title'=>'文章发布'.$id]); } // 文章发布处理 @@ -101,7 +101,7 @@ class ArticleController extends Controller $content = $_POST['content']; // 发布 - $update = DB::table('article') + $update = DB::table('articles') ->insert([ 'img' => $img, 'img_alt' => $img_alt, @@ -143,7 +143,7 @@ class ArticleController extends Controller return response('错误的参数id')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - $article = DB::table('article')->where('aid', $id)->first(); + $article = DB::table('articles')->where('aid', $id)->first(); return view('update', ['title'=>'文章编辑'.$id, 'article'=>$article]); } // 文章修改处理 @@ -162,7 +162,7 @@ class ArticleController extends Controller $content = $_POST['content']; // 获取 - $update = DB::table('article') + $update = DB::table('articles') ->where('aid', $aid) ->update([ 'title' => $title1, @@ -196,7 +196,7 @@ class ArticleController extends Controller if (session('uEmail', 'null') == 'null') { return response('你还没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - $delete = DB::table('article')->truncate(); + $delete = DB::table('articles')->truncate(); // 日志 DB::table('logs')->insert([ @@ -246,12 +246,12 @@ class ArticleController extends Controller public function articleAPI($id = 'new') { if ($id == 'new'){ - $article = DB::table('article')->orderBy('aid', 'desc')->first(); - // $article = DB::table('article')->where('aid', $new->aid)->get(); + $article = DB::table('articles')->orderBy('aid', 'desc')->first(); + // $article = DB::table('articles')->where('aid', $new->aid)->get(); $title = '最新文章'; $id = $article->aid; }else{ - $article = DB::table('article')->where('aid', $id)->first(); + $article = DB::table('articles')->where('aid', $id)->first(); } return view('api.article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); diff --git a/app/Http/Controllers/userController.php b/app/Http/Controllers/userController.php index 7c9f61d..71e6aea 100644 --- a/app/Http/Controllers/userController.php +++ b/app/Http/Controllers/userController.php @@ -26,7 +26,7 @@ class userController extends Controller $uPwd = $_POST['pwd']??'passwd'; // 查询数据库 - $data = DB::table('user')->where('uemail', $uEmail)->first(); + $data = DB::table('users')->where('uemail', $uEmail)->first(); // $data = DB::select('select * from user where uemail = ?', [$uEmail]); // 判断数据 @@ -113,14 +113,14 @@ class userController extends Controller $uOldPwd = $_POST['uOldPwd']??'passwd'; $uNewPwd = $_POST['uNewPwd']??'passwd'; - $data = DB::table('user')->where('uemail', $uEmail)->first(); + $data = DB::table('users')->where('uemail', $uEmail)->first(); if ($data == NULL){ return response('你没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); }elseif ($uOldPwd == $uNewPwd){ return response('新旧密码一致')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); }elseif ($uEmail == $data->uemail){ - $updata = DB::table('user')->where('uemail', $uEmail)->update(['upasswd'=>$uNewPwd]); + $updata = DB::table('users')->where('uemail', $uEmail)->update(['upasswd'=>$uNewPwd]); if ($updata) { DB::table('logs')->insert([ 'uid' => '1', -- Gitee From 6db0e0623de7109a406843f18663ea4ec1e3f692 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 22:43:10 +0800 Subject: [PATCH 21/42] feat:debug->$articles --- resources/views/home/main.blade.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 51eb6b4..e71b298 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -1,5 +1,8 @@ {{-- resources\views\home\main.blade.php --}}
+ @env('APP_DEBUG') + @dump($articles) + @endenv {{-- @dump($articles) --}} @include('custom.phpFunction') @foreach ($articles as $article) -- Gitee From 21db6616cb2ff1ecbfce3f7327aee59a60fb5a8e Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 22:48:53 +0800 Subject: [PATCH 22/42] feat:debug->$articles< --- resources/views/home/main.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index e71b298..068bd34 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -1,7 +1,7 @@ {{-- resources\views\home\main.blade.php --}}
@env('APP_DEBUG') - @dump($articles) + dump($articles) @endenv {{-- @dump($articles) --}} @include('custom.phpFunction') -- Gitee From c506e0fc79957bab2b538692918205504c78f7af Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:01:47 +0800 Subject: [PATCH 23/42] fix:.env --- .env.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 942d308..5d673c6 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,7 @@ APP_NAME=Blog2 APP_ENV=local APP_KEY=base64:Q+o4O+Ct51x574y4ekQgph1e0MoloZm9RySSLXX6Q2A= -# 生存环境下为false +# 生产环境下为false APP_DEBUG=true # 博客地址 APP_URL=127.0.0.1 -- Gitee From 149089afeb9377919344f337adacfdd0d7e9f67b Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:02:19 +0800 Subject: [PATCH 24/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/article/main.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 931279d..7f5a72b 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -22,7 +22,7 @@
\ No newline at end of file -- Gitee From 3963a352ccfb4c05970cfcbe5d7bd1f74bfc7203 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:03:54 +0800 Subject: [PATCH 25/42] undo:feat:debug->$articles && debug:true --- resources/views/article/main.blade.php | 2 +- resources/views/home/main.blade.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 7f5a72b..31bd1e4 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -1,5 +1,5 @@ {{-- resources\views\article\main.blade.php --}} -{{-- @dump($article) --}} +@dump($article) @include('custom.phpFunction') @php // 设置时区 diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 068bd34..1a6600f 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -1,9 +1,6 @@ {{-- resources\views\home\main.blade.php --}}
- @env('APP_DEBUG') - dump($articles) - @endenv - {{-- @dump($articles) --}} + @dump($articles) @include('custom.phpFunction') @foreach ($articles as $article) @php -- Gitee From 20c3661c5047e46a0502f442bf0bca6656d5bd8c Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:05:21 +0800 Subject: [PATCH 26/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug \ No newline at end of file -- Gitee From 406b91c65dc0aee78886180594633d2e91d9066b Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:11:58 +0800 Subject: [PATCH 27/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<=20&&=20deb?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 3 ++- resources/views/article/main.blade.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index 6021ea2..a7f6d78 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -160,7 +160,8 @@ class ArticleController extends Controller $title1 = $_POST['title1']; $title2 = $_POST['title2']; $content = $_POST['content']; - + return response($content); + // 获取 $update = DB::table('articles') ->where('aid', $aid) diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index cf4a16a..0b5e73a 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -22,7 +22,7 @@
\ No newline at end of file -- Gitee From 371209fa9de393e76f7f4cd195e34cd96cba34b2 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:13:24 +0800 Subject: [PATCH 28/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<=20&&=20deb?= =?UTF-8?q?ugwhere('aid', $aid) -- Gitee From 4beb9c6f81c9847eefd8fff65c29f6caf5af1fff Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 19 Dec 2023 23:19:37 +0800 Subject: [PATCH 29/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<=20&&=20deb?= =?UTF-8?q?ug< Date: Tue, 19 Dec 2023 23:20:27 +0800 Subject: [PATCH 30/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<=20&&=20deb?= =?UTF-8?q?ug< Date: Tue, 19 Dec 2023 23:23:05 +0800 Subject: [PATCH 31/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug< Date: Wed, 20 Dec 2023 11:49:19 +0800 Subject: [PATCH 32/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug< Date: Wed, 20 Dec 2023 12:11:32 +0800 Subject: [PATCH 33/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug< Date: Wed, 20 Dec 2023 12:13:58 +0800 Subject: [PATCH 34/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<]*>)([^<]*)(<)/","\\1\\3",$content); + // $content = str_replace("\r", "\n", $content); // $content = str_replace("`", "`", $content); // $content = str_replace("`", "\`", $content); -- Gitee From 6c4e655ce4fd58541e386eeac245a712fda4710b Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:15:19 +0800 Subject: [PATCH 35/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<]*>)([^<]*)(<)/","\\1\\3",$content); - // $content = str_replace("\r", "\n", $content); + $content = str_replace("\n", "\n", $content); + $content = str_replace(""" + """, "", $content); // $content = str_replace("`", "`", $content); // $content = str_replace("`", "\`", $content); -- Gitee From 000541ece29a5f7b61253121372725ad1aa3ad1d Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:18:13 +0800 Subject: [PATCH 36/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug< Date: Wed, 20 Dec 2023 12:32:52 +0800 Subject: [PATCH 37/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<
+ 支持MD语法.
- + @endsection \ No newline at end of file -- Gitee From c060c9bb4907ff8ad674d626bf9470d6eaa41b4f Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:44:07 +0800 Subject: [PATCH 38/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<where('aid', $id)->first(); } + $article->content = str_replace("`", "\\`", $article->content); return view('article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); } // 文章列表页(主页) @@ -160,11 +161,7 @@ class ArticleController extends Controller $title1 = $_POST['title1']; $title2 = $_POST['title2']; $content = $_POST['content']; - $content = str_replace("\r\n", "\n", $content); - // $content = str_replace("`", "`", $content); - // $content = str_replace("`", "\`", $content); - - // $content = str_replace('"', '\"', $content);// 多余? + // return response(dump($content));//debug // 获取 diff --git a/resources/views/update.blade.php b/resources/views/update.blade.php index a83f950..ced5c98 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -52,19 +52,11 @@

- 支持MD语法.
- @endsection \ No newline at end of file -- Gitee From 1187279a32f15a5d560af80a38298b11c023eae8 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:46:15 +0800 Subject: [PATCH 39/42] =?UTF-8?q?feat:=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=BD=BF=E7=94=A8'`'=E7=9A=84bug<<where('aid', $id)->first(); } + $article->content = str_replace("`", "\`", $article->content); return view('article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); } // 文章列表页(主页) @@ -160,11 +161,7 @@ class ArticleController extends Controller $title1 = $_POST['title1']; $title2 = $_POST['title2']; $content = $_POST['content']; - $content = str_replace("\r\n", "\n", $content); - // $content = str_replace("`", "`", $content); - // $content = str_replace("`", "\`", $content); - - // $content = str_replace('"', '\"', $content);// 多余? + // return response(dump($content));//debug // 获取 diff --git a/resources/views/update.blade.php b/resources/views/update.blade.php index a83f950..ced5c98 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -52,19 +52,11 @@

- 支持MD语法.
- @endsection \ No newline at end of file -- Gitee From df99322438ed86d1fe5b3098ddba6d1e669702a1 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:47:43 +0800 Subject: [PATCH 40/42] Merge branch 'dev' of https://gitee.com/IO0288/study_laravel_blog-2 into dev --- app/Http/Controllers/ArticleController.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index de3a027..2913ebb 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -24,11 +24,7 @@ class ArticleController extends Controller $article = DB::table('articles')->where('aid', $id)->first(); } -<<<<<<< HEAD $article->content = str_replace("`", "\`", $article->content); -======= - $article->content = str_replace("`", "\\`", $article->content); ->>>>>>> c060c9bb4907ff8ad674d626bf9470d6eaa41b4f return view('article', ['title'=>$id, 'article'=>$article, 'id'=>$id]); } // 文章列表页(主页) -- Gitee From 38fd27d91d3e69b45ffa8fc798324adda2d04910 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 12:50:10 +0800 Subject: [PATCH 41/42] feat:hidden debug dump --- resources/views/article/main.blade.php | 2 +- resources/views/home/main.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 0b5e73a..192e4a4 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -1,5 +1,5 @@ {{-- resources\views\article\main.blade.php --}} -@dump($article) + @include('custom.phpFunction') @php // 设置时区 diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 1a6600f..7940980 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -1,6 +1,6 @@ {{-- resources\views\home\main.blade.php --}}
- @dump($articles) + @include('custom.phpFunction') @foreach ($articles as $article) @php -- Gitee From c878f30560d61965251be624df4dbbb881bc90f2 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Wed, 20 Dec 2023 13:15:26 +0800 Subject: [PATCH 42/42] fix:a bug --- resources/views/home/main.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/home/main.blade.php b/resources/views/home/main.blade.php index 7940980..6c07d9c 100644 --- a/resources/views/home/main.blade.php +++ b/resources/views/home/main.blade.php @@ -1,6 +1,6 @@ {{-- resources\views\home\main.blade.php --}}
- + @include('custom.phpFunction') @foreach ($articles as $article) @php -- Gitee