From 4594a9acf32d0dd2af9ece39565bd597909d8c86 Mon Sep 17 00:00:00 2001 From: Furrium Network Date: Sun, 9 Aug 2026 23:51:30 +0800 Subject: [PATCH] Update auth.js --- js/auth.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; + } +}; + // ============================================================ // 🔐 认证 // ============================================================