import { get, uget, post, upost } from '@/http/index'
import myAxios from '@/http/axios'

// 获取角色列表
export const roleList = async (data) => {
  return await get('/system/role/list', data)
}

// 新增角色
export const addRole = async (data) => {
  return await post('/system/role/add', data)
}

// 修改保存角色
export const addEdit = async (data) => {
  return await post('/system/role/edit', data)
}

// 获取菜单列表
export const menuList = async (data) => {
  return await get('/system/menu/list', data)
}

export const roleDelete = async (data) => {
  return await uget('/system/role/delete/', data)
}

// 通过roleId 获取用户
export const listByRoleId = async (data) => {
  return await post('/system/user/listByRoleId', data)
}

// 获取用户列表
export const userList = async (data) => {
  return await get('/system/user/list', data)
}

// 批量取消授权用户
export const cancelAll = async (data) => {
  return await post('/system/role/authUser/cancelAll', data)
}
export const selectAll = async (data) => {
  return await post('/system/role/authUser/selectAll', data)
}
export const roleAuthMenu = async (data) => {
  return await post('/system/menu/roleAuthMenu', data)
}
