import { http } from '@/utils/http/axios';

/**
 * @description: 根据用户id获取用户菜单
 */
export function adminMenus() {
  return http.request({
    url: '/index/getMenus',
    method: 'GET',
  });
}

/**
 * 获取tree菜单列表
 * @param params
 */
export function getMenuList(params?) {
  return http.request({
    url: '/menu/list',
    method: 'GET',
    params,
  });
}
/**
 * 获取菜单详情
 * @param params
 */
export function getMenuDetail(id) {
  return http.request({
    url: '/menu/detail/'+id,
    method: 'GET',
  });
}
/**
 * @description: 添加菜单
 */
export function menuAdd(data:any) {
  return http.request({
    url: '/menu/add',
    method: 'POST',
    data,
  });
}
/**
 * @description: 更新菜单
 */
export function menuUpdate(data:any) {
  return http.request({
    url: '/menu/update',
    method: 'PUT',
    data
  });
}
/**
 * @description: 删除菜单
 */
export function menuDelete(id) {
  return http.request({
    url: '/menu/delete/'+id,
    method: 'DELETE',
  });
}