feat: add account reset

This commit is contained in:
engigu
2026-03-12 10:40:25 +08:00
parent a0aa9102ca
commit 22018856cc
6 changed files with 266 additions and 67 deletions
+2 -2
View File
@@ -53,7 +53,7 @@ export const api = {
login: (data: { username: string; password: string }) =>
request<{ user: string }>('/auth/login', { method: 'POST', body: JSON.stringify(data) }),
logout: () => request('/auth/logout', { method: 'POST' }),
me: () => request<{ username: string }>('/auth/me'),
me: () => request<{ username: string; role: string }>('/auth/me'),
register: (data: { username: string; password: string; email: string }) =>
request('/auth/register', { method: 'POST', body: JSON.stringify(data) })
},
@@ -126,7 +126,7 @@ export const api = {
taskStats: (days?: number) => request<TaskStatsItem[]>(`/taskstats${days ? `?days=${days}` : ''}`)
},
settings: {
changePassword: (data: { old_password: string; new_password: string }) =>
changePassword: (data: { old_username?: string; username?: string; old_password: string; new_password?: string }) =>
request('/settings/password', { method: 'POST', body: JSON.stringify(data) }),
getSite: () => request<SiteSettings>('/settings/site'),
getPublicSite: () => request<{ title: string; subtitle: string; icon: string; demo_mode: boolean }>('/settings/public'),