import request from "@/utils/request";
const api = "/mosty-api/mosty-base";
/*
 * 登录
 *  return promise 实例对象
 */
export const login = (data) => {
  return request({
    url: api + "/login",
    method: "POST",
    data
  });
};

/*
 * 获取用户信息
 *  return promise 实例对象
 */
export const getUserInfo = () => {
  return request({
    url: api + "/sys/profile",
    method: "GET"
  });
};

/*
 * 获取用户信息
 *  return promise 实例对象
 */
export const getKaptcha = () => {
  return request({
    url: api + "/kaptcha",
    method: "GET"
  });
};

/*
 * 多部门时候 切换部门刷新token
 *  return promise 实例对象
 */
export const refreshToken = (data) => {
  return request({
    url: api + `/token`,
    method: "POST",
    data
  });
};

/*
 *
登出
 *  return promise 实例对象
 */
export const loginOut = (data) => {
  return request({
    url: api + "/loginOut",
    method: "POST",
    data
  });
};

/*
 *
修改密码
 */
export const editPassword = (data) => {
  return request({
    url: api + "/sysUser/editPassword",
    method: "POST",
    data
  });
};

//  人员排名统计TOP10
export const ryStatistics = (data) => {
  return request({
    url: api + "/monitor/operlog/ryStatistics",
    method: "POST",
    data
  });
};

//  部门排名统计TOP10
export const bmStatistics = (data) => {
  return request({
    url: api + "/monitor/operlog/bmStatistics",
    method: "POST",
    data
  });
};

// 模块排名统计 
export const mkStatistics = (data) => {
  return request({
    url: api + "/monitor/operlog/mkStatistics",
    method: "POST",
    data
  });
};

//  系统使用情况统计数字
export const useStatistics = (data) => {
  return request({
    url: api + "/monitor/operlog/statistics",
    method: "POST",
    data
  });
};
