feat: 添加密码重置功能
- 后端: 新增 POST /auth/reset-password 端点(邮箱+验证码+新密码) - 后端: 新增 ResetPasswordRequest schema - 前端: 新增 /forgot-password 页面(分步骤:输入邮箱→验证码+新密码→完成) - 前端: 登录页添加"忘记密码?"链接 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
45c6c034e0
commit
3a6e25b5b1
@@ -115,6 +115,12 @@ export interface SendEmailCodeResponse {
|
||||
expires_in: number
|
||||
}
|
||||
|
||||
export interface ResetPasswordRequest {
|
||||
email: string
|
||||
email_code: string
|
||||
new_password: string
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
access_token: string
|
||||
refresh_token: string
|
||||
@@ -276,6 +282,14 @@ class ApiClient {
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
async resetPassword(data: ResetPasswordRequest): Promise<{ message: string }> {
|
||||
const response = await this.client.post<{ message: string }>('/auth/reset-password', data)
|
||||
return response.data
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user