diff --git a/js/auth.js b/js/auth.js index f30618d..9ba5245 100644 --- a/js/auth.js +++ b/js/auth.js @@ -1,3 +1,15 @@ +// ============================================================ +// AUTH 对象(供其他模块使用) +// ============================================================ + +const AUTH = { + async getUserProfile(userId) { + const data = await apiFetch('/users/' + userId); + if (data.error) throw new Error(data.error); + return data; + } +}; + // ============================================================ // 🔐 认证 // ============================================================