| | |
| | | import type { |
| | | DeptTree, |
| | | ResetPwdParam, |
| | | User, |
| | | UserImportParam, |
| | | UserInfoResponse, |
| | | } from './model'; |
| | | import type { DeptTree, ResetPwdParam, User, UserImportParam, UserInfoResponse } from './model'; |
| | | |
| | | import type { ID, IDS, PageQuery, PageResult } from '#/api/common'; |
| | | |
| | |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | deptRoleUserList = '/system/user/deptRoleUser', |
| | | deptTree = '/system/user/deptTree', |
| | | listDeptUsers = '/system/user/list/dept', |
| | | root = '/system/user', |
| | |
| | | userImportTemplate = '/system/user/importTemplate', |
| | | userList = '/system/user/list', |
| | | userResetPassword = '/system/user/resetPwd', |
| | | userStatusChange = '/system/user/changeStatus', |
| | | userStatusChange = '/system/user/changeStatus' |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | export function userList(params?: PageQuery) { |
| | | return requestClient.get<PageResult<User>>(Api.userList, { params }); |
| | | } |
| | | |
| | | export function deptRoleUserList(params?: any) { |
| | | return requestClient.get<User[]>(Api.deptRoleUserList, { params }); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @returns void |
| | | */ |
| | | export function userImportData(data: UserImportParam) { |
| | | return requestClient.post<{ code: number; msg: string }>( |
| | | Api.userImport, |
| | | data, |
| | | { |
| | | headers: { |
| | | 'Content-Type': ContentTypeEnum.FORM_DATA, |
| | | }, |
| | | isTransformResponse: false, |
| | | return requestClient.post<{ code: number; msg: string }>(Api.userImport, data, { |
| | | headers: { |
| | | 'Content-Type': ContentTypeEnum.FORM_DATA |
| | | }, |
| | | ); |
| | | isTransformResponse: false |
| | | }); |
| | | } |
| | | |
| | | /** |
| | |
| | | {}, |
| | | { |
| | | isTransformResponse: false, |
| | | responseType: 'blob', |
| | | }, |
| | | responseType: 'blob' |
| | | } |
| | | ); |
| | | } |
| | | |
| | |
| | | */ |
| | | export function userResetPassword(data: ResetPwdParam) { |
| | | return requestClient.putWithMsg<void>(Api.userResetPassword, data, { |
| | | encrypt: true, |
| | | encrypt: true |
| | | }); |
| | | } |
| | | |