修复个人资料

This commit is contained in:
Furrium Network authored and GitHub committed 2026-08-11 10:00:45 +08:00
1 parent 496234b519
commit d40c8bd866
1 file changed
+4 -4
+4 -4
View File
@@ -7,10 +7,10 @@ async function renderUserProfile(username) {
container.innerHTML = '<div style="text-align:center;color:#94a3b8;padding:40px 0;">加载中...</div>';
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 = '<div style="text-align:center;color:#ef4444;padding:40px 0;">用户不存在</div>';
return;
}