import { teamStore } from "@/store/team";
import { post } from "./axios";
async function useCorp(data) {
  const res = await post("corp", data);
  return res;
}

export async function simpleLogin(data) {
  const res = await useCorp({
    type: "simpleLogin",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}
export async function login(data) {
  const res = await useCorp({
    type: "login",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}

export async function loginout(data) {
  const res = await useCorp({
    type: "loginout",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}

export async function updatePassword(data) {
  const res = await useCorp({
    type: "updatePassword",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}

export async function getLoginLog(data) {
  const res = await useCorp({
    type: "getLoginLog",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}

export async function resetPassword(data) {
  const res = await useCorp({
    type: "resetPassword",
    corpId: sessionStorage.getItem("corpId"),
    ...data,
  });
  return res;
}

export async function getAccountList(data) {
  const res = await useCorp({
    type: "getAccountList",
    ...data,
  });
  return res;
}

export async function getAccountOptions(data) {
  const res = await useCorp({
    type: "getAccountOptions",
    ...data,
  });
  return res;
}

export async function setAccountState(data) {
  const res = await useCorp({
    type: "setAccountState",
    ...data,
  });
  return res;
}

export async function addCorpAccount(data) {
  const res = await useCorp({
    type: "addCorpAccount",
    ...data,
  });
  return res;
}

export async function editCorpAccount(data) {
  const res = await useCorp({
    type: "editCorpAccount",
    ...data,
  });
  return res;
}
