update
This commit is contained in:
parent
c8a93ddf65
commit
23bda4a56f
@ -5,7 +5,7 @@ if ($api_class == 'admin') {
|
|||||||
// 处理管理员请求
|
// 处理管理员请求
|
||||||
// ...
|
// ...
|
||||||
} else {
|
} else {
|
||||||
http_response_code(401)
|
http_response_code(401);
|
||||||
echo json_encode(['error' => 'Unauthorized', 'code' => 401]);
|
echo json_encode(['error' => 'Unauthorized', 'code' => 401]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
@ -16,7 +16,7 @@ elseif ($api_class != 'admin') {
|
|||||||
// 处理已登录用户请求
|
// 处理已登录用户请求
|
||||||
// ...
|
// ...
|
||||||
} else {
|
} else {
|
||||||
http_response_code(401)
|
http_response_code(401);
|
||||||
echo json_encode(['error' => 'Unauthorized', 'code' => 401]);
|
echo json_encode(['error' => 'Unauthorized', 'code' => 401]);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,7 @@ if ($article) {
|
|||||||
'article' => [
|
'article' => [
|
||||||
'title' => $article['title'],
|
'title' => $article['title'],
|
||||||
'author' => 'admin', // TODO:
|
'author' => 'admin', // TODO:
|
||||||
|
'auth_avatarUrl' => 'TODO',
|
||||||
'publishDate' => $article['publishDate'],
|
'publishDate' => $article['publishDate'],
|
||||||
'content' => $article['content']
|
'content' => $article['content']
|
||||||
],
|
],
|
||||||
@ -35,7 +36,7 @@ if ($article) {
|
|||||||
return [
|
return [
|
||||||
'id' => $comment['id'],
|
'id' => $comment['id'],
|
||||||
'author' => $comment['author'],
|
'author' => $comment['author'],
|
||||||
'avatarUrl' => $comment['avatarUrl'] ? $comment['avatarUrl'] : '/placeholder.svg?height=40&width=40',
|
'avatarUrl' => $comment['avatarUrl'] ? $comment['avatarUrl'] : '',
|
||||||
'content' => $comment['content']
|
'content' => $comment['content']
|
||||||
];
|
];
|
||||||
}, $comments)
|
}, $comments)
|
||||||
|
Loading…
Reference in New Issue
Block a user