Update api.js

This commit is contained in:
Furrium Network authored and GitHub committed 2026-08-09 23:41:36 +08:00
1 parent c674847586
commit 4ec329afbc
1 file changed
+26
+26
View File
@@ -329,5 +329,31 @@ const API = {
});
if (data.error) throw new Error(data.error);
return data;
},
// ============================================================
// 恢复码
// ============================================================
async generateRecoveryCodes() {
const data = await apiFetch('/auth/recovery-codes/generate', {
method: 'POST'
});
if (data.error) throw new Error(data.error);
return data;
},
async getRecoveryCodesCount() {
const data = await apiFetch('/auth/recovery-codes/count');
if (data.error) throw new Error(data.error);
return data;
},
async resetPassword(email, recoveryCode, newPassword) {
const data = await apiFetch('/auth/reset-password', {
method: 'POST',
body: JSON.stringify({ email, recoveryCode, newPassword })
});
if (data.error) throw new Error(data.error);
return data;
}
};