import { $post, $postParam } from "@/plugins/axios";

export const login = datas => {
  return $post("/api/admin/common/login", datas);
};
export const getSmsCode = datas => {
  return $post("/api/admin/common/get_verify_code", datas);
};
export const getSmsCodeForBind = datas => {
  return $post("/api/admin/common/get_verify_code_for_bind", datas);
};
export const logout = () => {
  return $post("/api/admin/common/logout", {});
};
export const sysMenu = () => {
  return $postParam("/api/admin/common/get_menu", {});
};
export const attachmentPreview = id => {
  return $postParam("/api/admin/common/file/preview", { id });
};
export const attachmentDetail = id => {
  return $postParam("/api/admin/common/file/get_one", { id });
};
export const attachmentDownload = ({ id, type }) => {
  return $postParam("/api/admin/common/file/download", { id, type });
};
export const getEnums = type => {
  return $postParam("/api/admin/common/get_enums", { type });
};
export const schoolList = () => {
  return $postParam("/api/admin/common/school/list", {});
};
export const getSchoolInfo = code => {
  return $postParam("/api/admin/common/school/query_by_school_code", { code });
};
export const getSysConfig = key => {
  return $postParam("/api/admin/common/sys_config/get_one", { key });
};
export const getSysTime = () => {
  return $postParam("/api/admin/common/get_system_time", {});
};
