|
|
@ -52,9 +52,9 @@ export const usePostListStore = defineStore('postList', {
|
|
|
|
avatar: post.userAvatar || require('@/assets/default-avatar/boy_1.png'),
|
|
|
|
avatar: post.userAvatar || require('@/assets/default-avatar/boy_1.png'),
|
|
|
|
title: post.title,
|
|
|
|
title: post.title,
|
|
|
|
summary: post.content ? post.content.slice(0, 40) + (post.content.length > 40 ? '...' : '') : '',
|
|
|
|
summary: post.content ? post.content.slice(0, 40) + (post.content.length > 40 ? '...' : '') : '',
|
|
|
|
|
|
|
|
viewCount: post.viewCount || 0,
|
|
|
|
likes: post.likeCount || 0,
|
|
|
|
likes: post.likeCount || 0,
|
|
|
|
comments: post.commentCount || 0,
|
|
|
|
comments: post.commentCount || 0,
|
|
|
|
favorites: post.favoriteCount || 0,
|
|
|
|
|
|
|
|
category: post.category || '全部',
|
|
|
|
category: post.category || '全部',
|
|
|
|
createTime: post.createTime,
|
|
|
|
createTime: post.createTime,
|
|
|
|
userName: post.userName,
|
|
|
|
userName: post.userName,
|
|
|
@ -70,6 +70,7 @@ export const usePostListStore = defineStore('postList', {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 处理错误情况
|
|
|
|
// 处理错误情况
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (error) {
|
|
|
|
} catch (error) {
|
|
|
|
// 处理异常情况
|
|
|
|
// 处理异常情况
|
|
|
|