import axios from '@/utils/request'

// 获取列表
export function authAdminList(query) {
  return axios({
    url: "/system/user/list",
    method: "get",
    params: query
  });
}


//根据当前角色，获取是否为客户角色
export function roleCustomers(query) {
  return axios({
    url: "/admin/auth/admin/roleCustomers",
    method: "get",
    params: query
  });
}

// 获取客户角色列表
export function authCustomerRoles(query) {
  return axios({
    url: "/admin/auth/admin/customerRoles",
    method: "get",
    params: query
  });
}

// 保存
export function authAdminSave(data, formName, method = "post") {
  let url =
    formName === "add"
      ? "/system/user/save"
      : "/system/user/edit";
  return axios({
    url: url,
    method: method,
    data: data
  });
}

// 删除管理员
export function authAdminDelete(data) {
  return axios({
    url: "/admin/auth/admin/delete",
    method: "post",
    data: data
  });
}

export function updateInv(data) {
  return axios({
    url: "/admin/auth/admin/updateInv",
    method: "post",
    data: data
  });
}

