From 0ef6b0a4a3f1184a7eaa05b99fddb7e7c42f9696 Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Thu, 30 Jul 2026 00:27:59 +0800 Subject: [PATCH] refactor(auth): split password.ts from auth.ts --- apps/web/src/api/auth/password.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 apps/web/src/api/auth/password.ts diff --git a/apps/web/src/api/auth/password.ts b/apps/web/src/api/auth/password.ts new file mode 100644 index 000000000..4791d129c --- /dev/null +++ b/apps/web/src/api/auth/password.ts @@ -0,0 +1,23 @@ +import apiClient from "../client" + +/** + * 请求密码重置 + */ +export const requestPasswordReset = async (email: string): Promise<{ message: string }> => { + const response = await apiClient.post("/auth/forgot-password", { email }) + return response.data +} + +/** + * 重置密码 + */ +export const resetPassword = async ( + token: string, + newPassword: string, +): Promise<{ message: string }> => { + const response = await apiClient.post("/auth/reset-password", { + token, + new_password: newPassword, + }) + return response.data +}