|
@@ -106,7 +106,7 @@ export interface SystemConfig {
|
|
|
export const adminApi = {
|
|
export const adminApi = {
|
|
|
// 获取系统统计
|
|
// 获取系统统计
|
|
|
getSystemStats(): Promise<ApiResponse<SystemStats>> {
|
|
getSystemStats(): Promise<ApiResponse<SystemStats>> {
|
|
|
- return request.get('/api/v1/admin/stats')
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/stats')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取用户列表(管理员视图)
|
|
// 获取用户列表(管理员视图)
|
|
@@ -124,7 +124,7 @@ export const adminApi = {
|
|
|
page: number
|
|
page: number
|
|
|
page_size: number
|
|
page_size: number
|
|
|
}>> {
|
|
}>> {
|
|
|
- return request.get('/api/v1/admin/users', { params })
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/users', { params })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 创建用户
|
|
// 创建用户
|
|
@@ -135,7 +135,7 @@ export const adminApi = {
|
|
|
phone?: string
|
|
phone?: string
|
|
|
is_superuser?: boolean
|
|
is_superuser?: boolean
|
|
|
}): Promise<ApiResponse<UserManagement>> {
|
|
}): Promise<ApiResponse<UserManagement>> {
|
|
|
- return request.post('/api/v1/admin/users', data)
|
|
|
|
|
|
|
+ return request.post('/api/v1/system/admin/users', data)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 更新用户
|
|
// 更新用户
|
|
@@ -145,24 +145,24 @@ export const adminApi = {
|
|
|
is_active?: boolean
|
|
is_active?: boolean
|
|
|
is_superuser?: boolean
|
|
is_superuser?: boolean
|
|
|
}): Promise<ApiResponse<UserManagement>> {
|
|
}): Promise<ApiResponse<UserManagement>> {
|
|
|
- return request.put(`/api/v1/admin/users/${userId}`, data)
|
|
|
|
|
|
|
+ return request.put(`/api/v1/system/admin/users/${userId}`, data)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 删除用户
|
|
// 删除用户
|
|
|
deleteUser(userId: string): Promise<ApiResponse> {
|
|
deleteUser(userId: string): Promise<ApiResponse> {
|
|
|
- return request.delete(`/api/v1/admin/users/${userId}`)
|
|
|
|
|
|
|
+ return request.delete(`/api/v1/system/admin/users/${userId}`)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 重置用户密码
|
|
// 重置用户密码
|
|
|
resetUserPassword(userId: string, newPassword: string): Promise<ApiResponse> {
|
|
resetUserPassword(userId: string, newPassword: string): Promise<ApiResponse> {
|
|
|
- return request.put(`/api/v1/admin/users/${userId}/password`, {
|
|
|
|
|
|
|
+ return request.put(`/api/v1/system/admin/users/${userId}/password`, {
|
|
|
new_password: newPassword
|
|
new_password: newPassword
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 强制用户下线
|
|
// 强制用户下线
|
|
|
forceUserLogout(userId: string): Promise<ApiResponse> {
|
|
forceUserLogout(userId: string): Promise<ApiResponse> {
|
|
|
- return request.post(`/api/v1/admin/users/${userId}/force-logout`)
|
|
|
|
|
|
|
+ return request.post(`/api/v1/system/admin/users/${userId}/force-logout`)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取应用列表(管理员视图)
|
|
// 获取应用列表(管理员视图)
|
|
@@ -180,12 +180,12 @@ export const adminApi = {
|
|
|
page: number
|
|
page: number
|
|
|
page_size: number
|
|
page_size: number
|
|
|
}>> {
|
|
}>> {
|
|
|
- return request.get('/api/v1/admin/apps', { params })
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/apps', { params })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 审核应用
|
|
// 审核应用
|
|
|
approveApp(appId: string, approved: boolean, reason?: string): Promise<ApiResponse> {
|
|
approveApp(appId: string, approved: boolean, reason?: string): Promise<ApiResponse> {
|
|
|
- return request.put(`/api/v1/admin/apps/${appId}/approve`, {
|
|
|
|
|
|
|
+ return request.put(`/api/v1/system/admin/apps/${appId}/approve`, {
|
|
|
approved,
|
|
approved,
|
|
|
reason
|
|
reason
|
|
|
})
|
|
})
|
|
@@ -206,7 +206,7 @@ export const adminApi = {
|
|
|
page: number
|
|
page: number
|
|
|
page_size: number
|
|
page_size: number
|
|
|
}>> {
|
|
}>> {
|
|
|
- return request.get('/api/v1/admin/logs', { params })
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/logs', { params })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取安全事件
|
|
// 获取安全事件
|
|
@@ -224,12 +224,12 @@ export const adminApi = {
|
|
|
page: number
|
|
page: number
|
|
|
page_size: number
|
|
page_size: number
|
|
|
}>> {
|
|
}>> {
|
|
|
- return request.get('/api/v1/admin/security/events', { params })
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/security/events', { params })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 处理安全事件
|
|
// 处理安全事件
|
|
|
handleSecurityEvent(eventId: string, action: string, note?: string): Promise<ApiResponse> {
|
|
handleSecurityEvent(eventId: string, action: string, note?: string): Promise<ApiResponse> {
|
|
|
- return request.put(`/api/v1/admin/security/events/${eventId}`, {
|
|
|
|
|
|
|
+ return request.put(`/api/v1/system/admin/security/events/${eventId}`, {
|
|
|
action,
|
|
action,
|
|
|
note
|
|
note
|
|
|
})
|
|
})
|
|
@@ -237,17 +237,17 @@ export const adminApi = {
|
|
|
|
|
|
|
|
// 获取系统配置
|
|
// 获取系统配置
|
|
|
getSystemConfig(): Promise<ApiResponse<SystemConfig>> {
|
|
getSystemConfig(): Promise<ApiResponse<SystemConfig>> {
|
|
|
- return request.get('/api/v1/admin/config')
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/config')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 更新系统配置
|
|
// 更新系统配置
|
|
|
updateSystemConfig(config: Partial<SystemConfig>): Promise<ApiResponse> {
|
|
updateSystemConfig(config: Partial<SystemConfig>): Promise<ApiResponse> {
|
|
|
- return request.put('/api/v1/admin/config', config)
|
|
|
|
|
|
|
+ return request.put('/api/v1/system/admin/config', config)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 系统备份
|
|
// 系统备份
|
|
|
createBackup(description?: string): Promise<ApiResponse<{ backup_id: string }>> {
|
|
createBackup(description?: string): Promise<ApiResponse<{ backup_id: string }>> {
|
|
|
- return request.post('/api/v1/admin/backup', { description })
|
|
|
|
|
|
|
+ return request.post('/api/v1/system/admin/backup', { description })
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 获取备份列表
|
|
// 获取备份列表
|
|
@@ -257,19 +257,19 @@ export const adminApi = {
|
|
|
size: number
|
|
size: number
|
|
|
created_at: string
|
|
created_at: string
|
|
|
}>>> {
|
|
}>>> {
|
|
|
- return request.get('/api/v1/admin/backups')
|
|
|
|
|
|
|
+ return request.get('/api/v1/system/admin/backups')
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 下载备份
|
|
// 下载备份
|
|
|
downloadBackup(backupId: string): Promise<Blob> {
|
|
downloadBackup(backupId: string): Promise<Blob> {
|
|
|
- return request.get(`/api/v1/admin/backups/${backupId}/download`, {
|
|
|
|
|
|
|
+ return request.get(`/api/v1/system/admin/backups/${backupId}/download`, {
|
|
|
responseType: 'blob'
|
|
responseType: 'blob'
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 数据导出
|
|
// 数据导出
|
|
|
exportData(type: 'users' | 'apps' | 'logs', format: 'csv' | 'json', filters?: Record<string, any>): Promise<Blob> {
|
|
exportData(type: 'users' | 'apps' | 'logs', format: 'csv' | 'json', filters?: Record<string, any>): Promise<Blob> {
|
|
|
- return request.post(`/api/v1/admin/export/${type}`, {
|
|
|
|
|
|
|
+ return request.post(`/api/v1/system/admin/export/${type}`, {
|
|
|
format,
|
|
format,
|
|
|
filters
|
|
filters
|
|
|
}, {
|
|
}, {
|
|
@@ -282,6 +282,6 @@ export const adminApi = {
|
|
|
cleaned_count: number
|
|
cleaned_count: number
|
|
|
types: string[]
|
|
types: string[]
|
|
|
}>> {
|
|
}>> {
|
|
|
- return request.post('/api/v1/admin/cleanup', { types })
|
|
|
|
|
|
|
+ return request.post('/api/v1/system/admin/cleanup', { types })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|