import { httpApp } from "@/plugins/axiosIndex";
import { object2QueryString, AESString } from "@/utils/utils";

export function loginByUsername({ loginName, password, code }) {
  const data = {
    loginName,
    password: AESString(password),
    code,
  };
  return httpApp.post("/api/admin/user/login/account", data, {
    noErrorMessage: true,
  });
}

export function logout() {
  return httpApp.post("/api/admin/user/logout");
}

export function getLogo(code) {
  return httpApp.post(
    "/api/admin/sys/org/queryByOrgCode?" +
      object2QueryString({
        code,
      })
  );
}
