import { http } from "../utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
interface userType extends Promise<any> {
  svg?: string;
  code?: number;
  info?: object;
}

// 获取验证码
export const getVerify = (): userType => {
  return http.request("get", "/captcha");
};

// 登录
export const getLogin = (data: object) => {
  return http.request("post", `${userAPi}/Api/login`, { data });
};
// 钉钉获取用户信息
export function ddDetail(data) {
  return http.request("post", `${userAPi}/Api/dintalk`, { data });
}
// 获取当前账号菜单数据
export const getAsyncRoutes = (data: object) => {
  return http.request("post", `${yewuApi}menu`, { data });
};

// 刷新token
export const refreshToken = (data: object) => {
  return http.request("post", "/refreshToken", { data });
};

// export const searchVague = (data: object) => {
//   return http.request("post", "/searchVague", { data });
// };
