From d40c8bd86617d6d49592d2547c6aa6b2fa273a26 Mon Sep 17 00:00:00 2001 From: Furrium Network Date: Tue, 11 Aug 2026 10:00:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA=E8=B5=84?= =?UTF-8?q?=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/user.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/user.js b/js/user.js index ab5df00..4d05be0 100644 --- a/js/user.js +++ b/js/user.js @@ -7,10 +7,10 @@ async function renderUserProfile(username) { container.innerHTML = '
加载中...
'; try { - const user = await apiFetch('/users/profile/' + encodeURIComponent(username)); - const user = users && users.length > 0 ? users[0] : null; - - if (!user) { + // 使用公开接口 /users/profile/:username + const user = await apiFetch('/users/profile/' + encodeURIComponent(username)); + + if (user.error || !user.id) { container.innerHTML = '
用户不存在
'; return; }