feat(admin): 修改密码页 + 首次登录强制改密;自绘标题栏与管理面板 Electron 窗口
This commit is contained in:
1 parent
4cbf5a74f0
commit
ab2f4d1cec
11 files changed
+197
-8
No files matched your search
@@ -115,6 +115,7 @@ export interface CrudApi<T, Input> {
|
||||
|
||||
export interface AuthApi {
|
||||
login(username: string, password: string): Promise<CurrentUser>
|
||||
changePassword(currentPassword: string, newPassword: string): Promise<{ relogin: boolean }>
|
||||
logout(): Promise<void>
|
||||
me(): Promise<CurrentUser>
|
||||
}
|
||||
@@ -349,6 +350,11 @@ export class ApiClient {
|
||||
this.auth = {
|
||||
login: (username, password) =>
|
||||
http.request<CurrentUser>('/auth/login', { method: 'POST', body: { username, password } }),
|
||||
changePassword: (currentPassword, newPassword) =>
|
||||
http.request<{ relogin: boolean }>('/auth/password', {
|
||||
method: 'POST',
|
||||
body: { currentPassword, newPassword },
|
||||
}),
|
||||
logout: () => http.requestVoid('/auth/logout', { method: 'POST' }),
|
||||
me: () => http.request<CurrentUser>('/auth/me'),
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user