import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { LoginData, LoginResult } from "./types";

/**
 * 登录API
 *
 * @param data {LoginData}
 * @returns
 */
export function loginApi(data: LoginData): AxiosPromise<LoginResult> {
  return request({
    url: "/board/v1/login",
    method: "post",
    data: data,
  });
}

/**
 * 注销API
 */
export function logoutApi() {
  return request({
    url: "/board/v1/logout",
    method: "post",
  });
}
