修复动态发布与互动问题

This commit is contained in:
2026-06-23 18:43:03 +08:00
parent 702b578e1e
commit cda8685956
151 changed files with 4993 additions and 914 deletions

View File

@@ -16,13 +16,12 @@ async function safeCount(collection, where) {
// Derive live stats from the source collections so the displayed numbers are
// always accurate instead of relying on a stored field that can drift.
async function computeStats(user) {
const [posts, favorites, following, followers] = await Promise.all([
const [posts, following, followers] = await Promise.all([
safeCount('posts', { authorId: user._id }),
safeCount('postFavorites', { openid: user.openid }),
safeCount('follows', { followerId: user._id }),
safeCount('follows', { followeeId: user._id })
])
return { posts, following, followers, favorites }
return { posts, following, followers }
}
exports.main = async event => {