feat: 添加重置邀请码验证状态功能,并在退出登录时调用

This commit is contained in:
Roe-xin
2026-01-27 20:16:13 +08:00
parent 31419e93a1
commit 6ef7e976cc
2 changed files with 36 additions and 2 deletions

View File

@ -368,3 +368,25 @@ export async function checkInvitationStatus(): Promise<InvitationStatusResponse>
method: "GET",
});
}
/**
* 重置邀请码验证状态(退出登录时调用)
* POST /api/invitation/reset
*/
export async function resetInvitationVerification(): Promise<{ code: number; msg: string }> {
console.log("[API] 重置邀请码验证状态");
try {
const response = await request<{ code: number; msg: string }>(
"/api/invitation/reset",
{
method: "POST",
},
);
console.log("[API] 重置邀请码验证状态 - 响应:", JSON.stringify(response));
return response;
} catch (error) {
console.warn("[API] 重置邀请码验证状态 - 错误:", error);
// 即使失败也不影响退出登录流程
throw error;
}
}