import { postJ, post, get } from "@/utils/request";
import Vue from "vue";

/**
 * 登录
 */
export async function login(data) {
  const res = await postJ(Vue.prototype.apiUrl + "/main/user/login", data);
  if (res.code == 0) {
    return res;
  }
  return Promise.reject(res.message);
}
/**
 * 获取用户信息
 */
export async function getLoginUser(data) {
  const res = await get(
    Vue.prototype.apiUrl + "/system/account/getLoginUser",
    data
  );
  if (res.code == 0) {
    return res.data;
  }
  return Promise.reject(res.message);
}
