import request from '@/config/request';

export const APIUser = {
  getUserInfos,
  updateUserInfo,
  loginOut,
  processList,
  process,
  modifyPassword,
  alarmList,
  getAdminList, //管理员列表
  wxAutoLogin, //微信自动登录
  getVerificationCode, //获取手机验证码
  wxLogin, //微信登陆
  wxVerifyLogin //微信短信登陆
};
export default APIUser;
// 获取用户信息
function getUserInfos(params) {
  return request({
    url: `/api/User/UserInfo`,
    method: 'post',
    data: params
  });
}
// 编辑用户信息
function updateUserInfo(params) {
  return request({
    url: `/api/User/UpdateUserInfo`,
    method: 'post',
    data: params
  });
}
// 退出登录
function loginOut({ headers, body }) {
  return request({
    url: `/api/User/WxLoginOut`, //2022.1.5 接口修改 LoginOut => WxLoginOut
    method: 'post',
    headers: headers,
    data: body
  });
}
// 获取用户系统消息
function processList(params) {
  return request({
    url: `/api/Request/ProcessList`,
    method: 'post',
    data: params
  });
}
// 是否同意申请关注
function process(params) {
  return request({
    url: `/api/Request/Process`,
    method: 'post',
    data: params
  });
}
// 修改密码
function modifyPassword(params) {
  return request({
    url: `/api/User/ModifyPassword`,
    method: 'post',
    data: params
  });
}
// 消息通知
function alarmList(params) {
  return request({
    url: `/api/Alarm/AlarmList`,
    method: 'post',
    data: params
  });
}
// 管理员列表
function getAdminList(params) {
  return request({
    url: `/api/User/AdminList`,
    method: 'post',
    data: params
  });
}

function wxAutoLogin(params) {
  return request({
    url: `/api/User/WxAutoLogin`,
    method: 'post',
    data: params
  });
}
function getVerificationCode(params) {
  return request({
    url: `/api/User/VerificationCode`,
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
function wxLogin(params) {
  return request({
    url: `/api/User/WxLogin`,
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}

function wxVerifyLogin(params) {
  return request({
    url: `/api/User/WxVerifyLogin`,
    method: 'post',
    headers: { AuthKey: 'key1' },
    data: params
  });
}
