import { Result, deleteRequest, get, post, put } from "../base"; /** * 分页查询 * @param query . * @returns . */ export function queryPage(query?: any): Promise> { return get("/sys/user/query/page", query); } /** * 列表查询 * @param query . * @returns . */ export function queryList(query?: any): Promise> { return get("/sys/user/query/list", query); } /** * 检查用户名是否存在 * @param username . * @returns . */ export function hashUsername(username: string): Promise> { return get("/sys/user/check/username", { username: username }); } /** * 新增 * @param data . * @returns . */ export function save(data: any): Promise> { return post("/sys/user/save", data); } /** * 更新 * @param id . * @param data . * @returns . */ export function update(id: string, data: any): Promise> { return put(`/sys/user/update/${id}`, {}, data); } /** * 获取用户角色ID * @param userId . * @returns . */ export function queryRoleIds(userId: string): Promise> { return get(`/sys/user/query/role/ids`, { id: userId }); } /** * 删除用户 * @param userIds . * @returns . */ export function del(userIds: string[]): Promise> { return deleteRequest(`/sys/user/delete`, {}, userIds); } /** * 重置密码 * @param username . * @param data . * @returns . */ export function resetPasswd( username: string, data: any ): Promise> { return put(`/sys/user/reset/passwd/${username}`, {}, data); } /** * 更新密码 * @param username . * @param data . * @returns . */ export function changePasswd( username: string, data: any ): Promise> { return put(`/sys/user/change/passwd/${username}`, {}, data); }