feat: add article state

This commit is contained in:
tim
2025-07-11 13:30:34 +08:00
parent 1e1d3dceb4
commit cac9544195
2 changed files with 6 additions and 3 deletions

View File

@@ -77,7 +77,7 @@ export default {
width: 2px;
bottom: -20px;
background: var(--text-color);
opacity: 0.2;
opacity: 0.08;
}
.timeline-item:last-child::before {

View File

@@ -17,7 +17,7 @@
PENDING
</div>
<div class="article-block-button">
BLOCK
REJECT
</div>
<div
v-if="loggedIn && !isAuthor && !subscribed"
@@ -211,7 +211,10 @@ export default {
const fetchPost = async () => {
try {
isWaitingFetchingPost.value = true;
const res = await fetch(`${API_BASE_URL}/api/posts/${postId}`)
const token = getToken()
const res = await fetch(`${API_BASE_URL}/api/posts/${postId}`, {
headers: { Authorization: token ? `Bearer ${token}` : '' }
})
isWaitingFetchingPost.value = false;
if (!res.ok) return
const data = await res.json()