mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
feat(auth): /me 接口返回 has_password 字段,前端 Profile 类型同步调整
This commit is contained in:
@@ -19,8 +19,8 @@ export interface Profile {
|
||||
created_at: string
|
||||
updated_at?: string
|
||||
last_login_at?: string
|
||||
auth_source?: 'local' | 'ldap' | 'oauth'
|
||||
has_password?: boolean
|
||||
auth_source: 'local' | 'ldap' | 'oauth'
|
||||
has_password: boolean
|
||||
preferences?: UserPreferences
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,8 @@ export const MOCK_ADMIN_PROFILE: Profile = {
|
||||
role: 'admin',
|
||||
is_active: true,
|
||||
billing: MOCK_ADMIN_BILLING,
|
||||
auth_source: 'local',
|
||||
has_password: true,
|
||||
created_at: '2024-01-01T00:00:00Z',
|
||||
updated_at: new Date().toISOString(),
|
||||
last_login_at: new Date().toISOString(),
|
||||
@@ -119,6 +121,8 @@ export const MOCK_USER_PROFILE: Profile = {
|
||||
role: 'user',
|
||||
is_active: true,
|
||||
billing: MOCK_USER_BILLING,
|
||||
auth_source: 'local',
|
||||
has_password: true,
|
||||
created_at: '2024-06-01T00:00:00Z',
|
||||
updated_at: new Date().toISOString(),
|
||||
last_login_at: new Date().toISOString(),
|
||||
|
||||
@@ -518,7 +518,7 @@ const mockHandlers: Record<string, (config: AxiosRequestConfig) => Promise<Axios
|
||||
// ========== 用户信息 ==========
|
||||
'GET /api/users/me': async () => {
|
||||
await delay()
|
||||
return createMockResponse(getCurrentUser())
|
||||
return createMockResponse(getCurrentProfile())
|
||||
},
|
||||
|
||||
'PUT /api/users/me': async () => {
|
||||
|
||||
Reference in New Issue
Block a user