import request from "@/utils/request";
import {BASE_URL} from '@/config';


export const getRoleList = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/role/getRoleList`,
        params,
    });
};



export const getRoleSelect = () => {
    return request({
        method: 'post',
        url: `${BASE_URL}/role/getAllRoleList`
    });
}

// 删除角色
export const deleteRole = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/role/deleteRole`,
        params,
    });
}

// 保存角色
export const saveRole = (data) => {
    return request({
        method: 'post',
        url: `${BASE_URL}/role/saveRole`,
        data,
    });
}

// 获取权限树

export const getRoleTree = (params) => {
    return request({
        method: 'get',
        url: `${BASE_URL}/role/getRoleInfo`,
        params,
    });
}