diff --git a/app/Http/Controllers/ArticleController.php b/app/Http/Controllers/ArticleController.php index a24ed990d131d986091ddc923d1277e967901b22..d891da941d4cf4587b761a87c1dd9983632992b2 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 6a0e653d826b9cb5c83d7c8f2775fbc8850b43a0..542464d2ac8df6814cd02425c01e7407894a2495 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 192e4a402817c92951994cc66bc43e89d5d4a538..b535fe65f1af71016a2433a10f083821179bcc86 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 c80607a20d0f5bb61081ed14963101c290d0ca0f..62fc6be216359dad2a47288b79bfb7faa0e3cc41 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 ced5c986a1b27411078b6dbaff9f749a313f638b..95b409f4f9cd9b9703bd9b4048b26058d20ae104 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -15,46 +15,62 @@ {{--
@include('admin.main')
--}} -
-
+
+
@csrf - -
- - +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - +
+
+ + +
+
+ + +
-
+
-
+
-
+

支持MD语法.
- +
+ + +