From da0252207e0933a2afb785f026136dce31353b76 Mon Sep 17 00:00:00 2001 From: Furrium Network Date: Sun, 9 Aug 2026 19:52:55 +0800 Subject: [PATCH] Update user.js --- js/user.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/user.js b/js/user.js index 50fea44..19d344f 100644 --- a/js/user.js +++ b/js/user.js @@ -1,3 +1,5 @@ +cd /root/forumlify +cat > js/user.js << 'EOF' // ============================================================ // 👤 用户主页 // ============================================================ @@ -18,8 +20,9 @@ async function renderUserProfile(username) { document.getElementById('userPageTitle').textContent = '👤 ' + user.username; - // 2. 获取该用户的帖子 - const posts = await apiFetch('/posts?user_id=' + user.id); + // 2. 获取该用户的帖子(适配分页格式) + const result = await apiFetch('/posts?user_id=' + user.id + '&page=1&limit=100'); + const posts = result.data || []; const avatar = user.avatar_url || 'https://ui-avatars.com/api/?name=' + encodeURIComponent(user.username) + '&background=6366f1&color=fff&size=128'; @@ -86,3 +89,6 @@ function showUserPage(username) { currentPage = 'user'; renderUserProfile(username); } +EOF + +docker-compose restart app