From cf248a11bd5fc88a6714a55f75f7849dd8326837 Mon Sep 17 00:00:00 2001 From: IO0288 Date: Tue, 26 Dec 2023 04:58:34 +0000 Subject: [PATCH] =?UTF-8?q?!5=20=E6=9B=B4=E6=96=B0=E8=87=B3=E4=B8=BB?= =?UTF-8?q?=E5=88=86=E6=94=AF=EF=BC=8C=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=81=E6=96=87=E7=AB=A0=E4=BF=AE=E6=94=B9=E9=A1=B5=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=20*=20feat:=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=20*?= =?UTF-8?q?=20feat:=E5=B0=9D=E8=AF=95=E5=9C=A8=E5=8F=91=E5=B8=83/=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=A1=B5=E9=9D=A2=E5=8A=A0=E5=85=A5uid/cid=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20*=20fix:rename=20table=5Fname=20*=20feat:=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A0=B7=E5=BC=8F=EF=BC=8C=E4=B8=BA=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=A0=B7=E5=BC=8F=E5=81=9A=E5=87=86=E5=A4=87?= =?UTF-8?q?=20*=20fix:=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96=20*=20feat:?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=E9=A1=B5=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=86=E7=B1=BBa=E6=A0=87=E7=AD=BE=20*=20feat:=E5=9C=A8?= =?UTF-8?q?=E6=96=87=E7=AB=A0=E8=AF=A6=E6=83=85=E9=A1=B5=E4=B8=AD=E5=8A=A0?= =?UTF-8?q?=E5=85=A5=E5=88=86=E7=B1=BB=E6=98=BE=E7=A4=BA=20*=20fix:a=20bug?= =?UTF-8?q?=20for=20t=5Fclassify?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/ArticleController.php | 23 ++++----- resources/views/admin/updatapwd.blade.php | 6 +-- resources/views/article/main.blade.php | 7 ++- resources/views/index.blade.php | 3 +- resources/views/update.blade.php | 56 ++++++++++++++-------- 5 files changed, 58 insertions(+), 37 deletions(-) diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index a24ed99..d891da9 100644 --- a/app/Http/Controllers/ArticleController.php +++ b/app/Http/Controllers/ArticleController.php @@ -17,7 +17,7 @@ class ArticleController extends Controller { if ($id == 'new'){ $article = DB::table('articles')->orderBy('aid', 'desc')->first(); - // $article = DB::table('articles')->where('aid', $new->aid)->get(); + // $articles = DB::table('articles')->where('aid', $new->aid)->get(); $title = '最新文章'; $id = $article->aid; }else{ @@ -25,7 +25,8 @@ class ArticleController extends Controller } $article->content = str_replace("`", "\`", $article->content); - return view('article', ['title'=>$id, 'articles'=>$articles, 'classify'=>$classify, 'id'=>$id]); + $classify = DB::table('classify')->get(); + return view('article', ['title'=>$id, 'article'=>$article, 'classify'=>$classify, 'id'=>$id]); } // 文章列表页(主页) public function articleList() @@ -45,8 +46,8 @@ class ArticleController extends Controller return response('你还没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - $articleList = DB::table('articles')->get(); - return view('admin.article', ['title'=>'文章管理', 'list'=>$articleList]); + $articlesList = DB::table('articles')->get(); + return view('admin.article', ['title'=>'文章管理', 'list'=>$articlesList]); } // 文章删除 @@ -86,7 +87,7 @@ class ArticleController extends Controller return response('你还没有登录')->header('refresh', env('USER_WAIT', '5').';url='.env('APP_URL')); } - // $article = DB::table('articles')->where('aid', $id)->first(); + // $articles = DB::table('articles')->where('aid', $id)->first(); return view('insert', ['title'=>'文章发布'.$id]); } // 文章发布处理 @@ -147,7 +148,7 @@ class ArticleController extends Controller } $article = DB::table('articles')->where('aid', $id)->first(); $classify = DB::table('classify')->get(); - return view('update', ['title'=>'文章编辑'.$id, 'articles'=>$articles, 'classify'=>$classify]); + return view('update', ['title'=>'文章编辑'.$id, 'article'=>$article, 'classify'=>$classify]); } // 文章修改处理 public function updateCheck($id = null) @@ -255,15 +256,15 @@ class ArticleController extends Controller public function articleAPI($id = 'new') { if ($id == 'new'){ - $article = DB::table('articles')->orderBy('aid', 'desc')->first(); - // $article = DB::table('articles')->where('aid', $new->aid)->get(); + $articles = DB::table('articles')->orderBy('aid', 'desc')->first(); + // $articles = DB::table('articles')->where('aid', $new->aid)->get(); $title = '最新文章'; - $id = $article->aid; + $id = $articles->aid; }else{ - $article = DB::table('articles')->where('aid', $id)->first(); + $articles = DB::table('articles')->where('aid', $id)->first(); } $classify = DB::table('classify')->get(); - return view('api.article', ['title'=>$id, 'article'=>$article, 'classify'=>$classify, 'id'=>$id]); + return view('api.article', ['title'=>$id, 'article'=>$articles, 'classify'=>$classify, 'id'=>$id]); } } \ No newline at end of file diff --git a/resources/views/admin/updatapwd.blade.php b/resources/views/admin/updatapwd.blade.php index 6a0e653..542464d 100644 --- a/resources/views/admin/updatapwd.blade.php +++ b/resources/views/admin/updatapwd.blade.php @@ -25,7 +25,6 @@
@csrf -
- 填写自己帐号的原有密码. + 填写自己帐号的原有密码.
+ 输入新密码.
- +
diff --git a/resources/views/article/main.blade.php b/resources/views/article/main.blade.php index 192e4a4..b535fe6 100644 --- a/resources/views/article/main.blade.php +++ b/resources/views/article/main.blade.php @@ -4,14 +4,17 @@ @php // 设置时区 date_default_timezone_set(env('USER_TIMEZONE', 'PRC')); + $classify_kv = array_column(objectToArray($classify), 'cname', 'cid'); + $cid = $article->cid; @endphp

{{ merge_str($article->title, $article->title2) }}


-创建于:{{ date("Y-m-d H:i",$article->date) }}/最后修改于:{{ date("Y-m-d H:i",$article->lastdate) }} +创建于:{{ date("Y-m-d H:i",$article->date)."/最后修改于:".date("Y-m-d H:i",$article->lastdate)." |"}} @php + echo ' $cid : $classify_kv[$cid]".''; if (session('uEmail', 'null') != 'null') { - echo 'Edit'; + echo ' | Edit'; } @endphp

diff --git a/resources/views/index.blade.php b/resources/views/index.blade.php index c80607a..62fc6be 100644 --- a/resources/views/index.blade.php +++ b/resources/views/index.blade.php @@ -37,7 +37,8 @@ cursor: pointer; } /* (全局)补充样式 */ - code {background: #eeeeeeaa;} + p>code {background: #eeeeeeaa;} + pre {background: #eeeeeeaa;} diff --git a/resources/views/update.blade.php b/resources/views/update.blade.php index ced5c98..95b409f 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -15,46 +15,62 @@ {{--
@include('admin.main')
--}} -
-
+
+
@csrf - -
- - +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - +
+
+ + +
+
+ + +
-
+
-
+
-
+

支持MD语法.
- +
+ + +
-- Gitee