import type { UserDto } from './generated/models/UserDto' import type { UserDtoPagedResultDto } from './generated/models/UserDtoPagedResultDto' import { axiosInstance } from './axios-config' import { resolveAdminApiPath } from '@/utils/adminApi' function internalUserListUrl() { return resolveAdminApiPath('/rbac/user/internal-list') } function resetPasswordUrl() { return resolveAdminApiPath('/rbac/user/reset-password') } /** 内部用户列表(排除纯客户账号),响应结构与 UserDtoPagedResultDto 兼容 */ export async function getInternalUserList(params: { keyword?: string organizationId?: string page?: number pageSize?: number }): Promise { const res = await axiosInstance.get(internalUserListUrl(), { params }) return res.data } /** 管理员重置用户密码(无需旧密码) */ export async function resetUserPassword(id: string, newPassword: string): Promise { await axiosInstance.post(resetPasswordUrl(), { newPassword }, { params: { id } }) } export type { UserDto }