import createAxios from '@/utils/request'

export const functionTree = () => {
    return createAxios({
        url: '/user-boot/function/functionTree'
    })
}

// 新增菜单接口
export function add(data: anyObj) {
    return createAxios({
        url: '/user-boot/function/add',
        method: 'post',
        data: data
    })
}

// 修改菜单接口
export function update(data: anyObj) {
    return createAxios({
        url: '/user-boot/function/update',
        method: 'put',
        data: data
    })
}

// 删除菜单接口
export function deleteMenu(id: string) {
    return createAxios({
        url: '/user-boot/function/delete?id=' + id,
        method: 'delete',
    })
}

// 更新角色菜单
export function updateRoleMenu(data:any) {
    return createAxios({
        url: '/user-boot/function/assignFunctionByRoleIndexes',
        method: 'post',
        data: data
    })
}