From 23bda4a56f08f0cdedeb11f61983c046b2685539 Mon Sep 17 00:00:00 2001 From: mei Date: Sun, 3 Nov 2024 12:54:31 +0800 Subject: [PATCH] update --- core/router.php | 4 ++-- includes/{submit_comment.php => comments/messages.php} | 0 includes/public/article.php | 3 ++- index.php | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) rename includes/{submit_comment.php => comments/messages.php} (100%) diff --git a/core/router.php b/core/router.php index 06e23c5..ab087d0 100644 --- a/core/router.php +++ b/core/router.php @@ -5,7 +5,7 @@ if ($api_class == 'admin') { // 处理管理员请求 // ... } else { - http_response_code(401) + http_response_code(401); echo json_encode(['error' => 'Unauthorized', 'code' => 401]); exit; } @@ -16,7 +16,7 @@ elseif ($api_class != 'admin') { // 处理已登录用户请求 // ... } else { - http_response_code(401) + http_response_code(401); echo json_encode(['error' => 'Unauthorized', 'code' => 401]); exit; } diff --git a/includes/submit_comment.php b/includes/comments/messages.php similarity index 100% rename from includes/submit_comment.php rename to includes/comments/messages.php diff --git a/includes/public/article.php b/includes/public/article.php index c065f79..a4cbc82 100644 --- a/includes/public/article.php +++ b/includes/public/article.php @@ -28,6 +28,7 @@ if ($article) { 'article' => [ 'title' => $article['title'], 'author' => 'admin', // TODO: + 'auth_avatarUrl' => 'TODO', 'publishDate' => $article['publishDate'], 'content' => $article['content'] ], @@ -35,7 +36,7 @@ if ($article) { return [ 'id' => $comment['id'], 'author' => $comment['author'], - 'avatarUrl' => $comment['avatarUrl'] ? $comment['avatarUrl'] : '/placeholder.svg?height=40&width=40', + 'avatarUrl' => $comment['avatarUrl'] ? $comment['avatarUrl'] : '', 'content' => $comment['content'] ]; }, $comments) diff --git a/index.php b/index.php index 1036c46..a927101 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,6 @@