import { httpApp } from "@/plugins/axiosApp";

export function loginByUsername({
  accountType,
  accountValue,
  sessionType,
  password,
}) {
  const data = {
    accountType,
    accountValue,
    password,
    sessionType,
  };
  return httpApp.post(
    "/ocean/api/ocean-cloud-security/security/adminUserLogin",
    data
  );
}

export function loginByPhone({ securityPhone, securityCode }) {
  const data = {
    securityPhone,
    securityCode,
  };
  return httpApp.post(
    "/ocean/api/ocean-cloud-security/security/adminUserSmsLogin",
    data
  );
}

export function sendSMS({ securityPhone }) {
  const data = {
    securityPhone,
  };
  return httpApp.post(
    "/ocean/api/ocean-cloud-security/security/sendSms4AdminUser",
    data
  );
}

export function logout() {
  return httpApp.post({
    url: "/login/logout",
  });
}
