// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取当前的用户 GET  */
export async function currentUser(params: {
  person_id: number;
  identity_id: number;
  u_type: number;
  random_num?: number;
}) {
  return request('/dsideal_yy/ypt/userinfo/getUserInfo', {
    method: 'GET',
    params,
  });
}

/** 获取用户头像 GET */
export async function queryPersonTxByYw(params: {
  person_id: number;
  identity_id: number;
  u_type?: number;
  random_num?: number;
}) {
  return request('/dsideal_yy/person/getPersonTxByYw', {
    method: 'GET',
    params,
  });
}

/** 获取用户信息 */
export async function queryPersonInfo(params: {
  person_id: number;
  identity_id: number;
  random_num?: number;
}) {
  return request('/dsideal_yy/person/getPersonInfo', {
    method: 'GET',
    params,
  });
}

/** 退出登录接口 */
export async function outLogin(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/dsideal_yy/login/doLogout?login_type=1', {
    method: 'POST',
    ...(options || {}),
  });
}

/** 登录接口 POST */
export async function login(body: API.LoginParams, options?: { [key: string]: any }) {
  return request<API.LoginResult>('/dsideal_yy/login/doLogin?login_type=1', {
    method: 'POST',
    requestType: 'form',
    data: body,
    ...(options || {}),
  });
}
