feat(auth): /me 接口返回 has_password 字段,前端 Profile 类型同步调整

This commit is contained in:
fawney19
2026-04-24 14:52:49 +08:00
parent 780f09c1a2
commit e0c928fbe8
5 changed files with 16 additions and 3 deletions

View File

@@ -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
}

View File

@@ -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(),

View File

@@ -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 () => {