// @ts-ignore
/* eslint-disable */
import request from '@/request/http'

/** 切换企业 PUT /anyone/switchTenantAndOrg */
export async function switchTenantAndOrg(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.switchTenantAndOrgParams,
  options?: { [key: string]: any }
) {
  return request<API.RLoginResultVO>(`/oauth/anyone/switchTenantAndOrg`, {
    method: 'PUT',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 检测手机号是否存在 GET /anyTenant/checkMobile */
export async function checkMobile(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.checkMobileParams,
  options?: { [key: string]: any }
) {
  return request<API.RBoolean>(`/oauth/anyTenant/checkMobile`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 登录接口 登录或者清空缓存时调用 POST /anyTenant/login */
export async function login(body: API.LoginParamVO, options?: { [key: string]: any }) {
  return request<API.RLoginResultVO>(`/oauth/anyTenant/login`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 刷新token[前端 vben5版本 有效] token过期时，刷新token使用 POST /anyTenant/refresh */
export async function refresh(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.refreshParams,
  options?: { [key: string]: any }
) {
  return request<API.RLoginResultVO>(`/oauth/anyTenant/refresh`, {
    method: 'POST',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 根据邮箱注册 根据邮箱注册 POST /anyTenant/registerByEmail */
export async function register1(body: API.RegisterByEmailVO, options?: { [key: string]: any }) {
  return request<API.RString>(`/oauth/anyTenant/registerByEmail`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 根据手机号注册 根据手机号注册 POST /anyTenant/registerByMobile */
export async function register(body: API.RegisterByMobileVO, options?: { [key: string]: any }) {
  return request<API.RString>(`/oauth/anyTenant/registerByMobile`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    data: body,
    ...(options || {})
  })
}

/** 更新手机号 POST /anyTenant/updateMobile */
export async function updateMobile1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.updateMobile1Params,
  options?: { [key: string]: any }
) {
  return request<API.R>(`/oauth/anyTenant/updateMobile`, {
    method: 'POST',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 验证token是否正确 验证token GET /anyTenant/verify */
export async function verify(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.verifyParams,
  options?: { [key: string]: any }
) {
  return request<API.RSaSession>(`/oauth/anyTenant/verify`, {
    method: 'GET',
    params: {
      ...params
    },
    ...(options || {})
  })
}

/** 退出 退出 POST /anyUser/logout */
export async function logout(options?: { [key: string]: any }) {
  return request<API.RBoolean>(`/oauth/anyUser/logout`, {
    method: 'POST',
    ...(options || {})
  })
}
