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; width: 2px;
bottom: -20px; bottom: -20px;
background: var(--text-color); background: var(--text-color);
opacity: 0.2; opacity: 0.08;
} }
.timeline-item:last-child::before { .timeline-item:last-child::before {

View File

@@ -17,7 +17,7 @@
PENDING PENDING
</div> </div>
<div class="article-block-button"> <div class="article-block-button">
BLOCK REJECT
</div> </div>
<div <div
v-if="loggedIn && !isAuthor && !subscribed" v-if="loggedIn && !isAuthor && !subscribed"
@@ -211,7 +211,10 @@ export default {
const fetchPost = async () => { const fetchPost = async () => {
try { try {
isWaitingFetchingPost.value = true; 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; isWaitingFetchingPost.value = false;
if (!res.ok) return if (!res.ok) return
const data = await res.json() const data = await res.json()