import request from "@/utils/request"

//用户列表
export function getUserList(params) {
    return request({
        url: "/qdport-system/sys/user/list",
        method: "GET",
        params
    })
}

//用户拥有的角色
export function byUserIdfnRole(userId) {
    return request({
        url: `/qdport-system/sys/user/${userId}/role/list`,
        method: "GET",
    })
}
//更新用户角色
export function byUserIduPRole(userId, data) {
    return request({
        url: `/qdport-system/sys/user/${userId}/role/update`,
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        data
    })
}


//新增
export function addUser(data) {
    return request({
        url: "/qdport-system/sys/user/add",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        data
    })
}
//修改
export function modUser(data) {
    return request({
        url: "/qdport-system/sys/user/update",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        data
    })
}
//批量删除
export function delUser(data) {
    return request({
        url: "/qdport-system/sys/user/delete/ids",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        data
    })
}
//批量重置密码
export function restPwdUser(data) {
    return request({
        url: "/qdport-system/sys/user/resetPassword",
        method: "post",
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        data
    })
}

