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

/**
 * @description: 获取动态菜单
 */
export function adminMenus() {
  return http.request({
    url: '/login/getRouters',
    method: 'GET',
  });
}

/**
 * 获取tree菜单列表
 * @param params
 */
export function getMenuList(params?) {
  return http.request({
    url: '/menu/menuList',
    method: 'GET',
    params,
  });
}

/**
 * 添加菜单
 * @param params
 */
export function addMenu(params?) {
  return http.request({
    url: '/menu/add',
    method: 'POST',
    params,
  });
}

/**
 * 编辑菜单
 * @param params
 */
export function editMenu(params?) {
  return http.request({
    url: '/menu/update',
    method: 'POST',
    params,
  });
}

/**
 * 菜单信息
 * @param params
 */
export function menuInfo(params?) {
  return http.request({
    url: '/menu/info',
    method: 'GET',
    params,
  });
}

/**
 * 删除菜单
 * @param params
 */
export function deleteMenu(params) {
  return http.request({
    url: '/menu/delete',
    method: 'POST',
    params,
  });
}
