import request from "@/utils/request";

// export const  login= (params)=>post('/admin/user/tg-info/login',params)
// export const getCodeImg = (params)=>get('auth/vCode',params)

export function login(loginName, password, captcha, uuid) {
  console.log(loginName, password, captcha, uuid);
  return request({
    url: "/admin/rbac/auth/login",
    method: "post",
    data: {
      loginName,
      password,
      captcha,
      uuid
    }
  });
}

export function getInfo() {
  return request({
    url: "/admin/rbac/auth/info",
    method: "post"
  });
}

export function getCodeImg() {
  return request({
    url: "/admin/rbac/auth/captcha",
    method: "get"
  });
}

export function loginPhone(params) {
  return request({
    url: "/admin/rbac/auth/messageValid",
    method: "get",
    params
  });
}

export function logout(params) {
  return request({
    url: "/admin/rbac/auth/logout",
    method: "post",
    params
  });
}

// up统一认证登录
export function ldapLogin(data) {
  return request({
    url: "/admin/rbac/auth/loginNew",
    method: "post",
    data
  });
}

// 获取当前用户所属部门
export function getUserDept() {
  return request({
    url: "/admin/rbac/auth/selectDept",
    method: "post"
  });
}

// 登录部门
export function loginDept(data) {
  return request({
    url: "/admin/rbac/auth/loginDept",
    method: "post",
    data
  });
}
