Update api.js

This commit is contained in:
Furrium Network authored and GitHub committed 2026-08-09 23:02:28 +08:00
1 parent 4ac816df19
commit daba717571
1 file changed
+12 -1
+12 -1
View File
@@ -268,7 +268,6 @@ const API = {
// ============================================================
// 自定义页面
// ============================================================
async getCustomPages() {
const data = await apiFetch('/custom-pages');
if (data.error) throw new Error(data.error);
@@ -309,5 +308,17 @@ const API = {
const data = await apiFetch('/admin/custom-pages/' + id, { method: 'DELETE' });
if (data.error) throw new Error(data.error);
return data;
},
// ============================================================
// 头像
// ============================================================
async updateAvatar(userId, avatar_url) {
const data = await apiFetch('/users/' + userId + '/avatar', {
method: 'PUT',
body: JSON.stringify({ avatar_url })
});
if (data.error) throw new Error(data.error);
return data;
}
};