import request from "@/utils/request";

//获取用户列表
const list = (data) => {
    return request({
        url: `/users`,
        method: "get",
        params: data
    });
}
//新增用户
const add = (data) => {
    return request({
        url: `/users`,
        method: "post",
        data: data
    });
}
//删除用户
const deleteUser = (id) => {
    return request({
        url: `/users/${id}`,
        method: "delete"
    });
}
//更新用户密码
const updatePassword = (id, data) => {
    return request({
        url: `/users/${id}/password`,
        method: "put",
        data: data
    });
}
//更新用户信息
const updateAuth = (id, data) => {
    return request({
        url: `/users/${id}/auth`,
        method: "put",
        data: data
    });
}

export default {
    list,
    add,
    deleteUser,
    updateAuth,
    updatePassword
}