fix: create post

This commit is contained in:
yanghao05
2025-04-09 20:32:31 +08:00
parent 05d2ecc2b9
commit 2346983d67
10 changed files with 192 additions and 95 deletions

View File

@@ -131,7 +131,7 @@ const fetchPosts = async () => {
keyword: globalFilterValue.value
});
posts.value = response.items.map(post => ({
posts.value = response.data.items.map(post => ({
...post,
status: statusMap[post.status] || '未知',
mediaTypes: getMediaTypes(post.assets),
@@ -140,7 +140,7 @@ const fetchPosts = async () => {
viewCount: post.views,
likes: post.likes
}));
total.value = response.total;
total.value = response.data.total;
} catch (error) {
console.error('Fetch error:', error); // Debug log
toast.add({ severity: 'error', summary: '错误', detail: '加载文章失败', life: 3000 });