import request from '@/utils/request';

export interface LoginParamsType {
  userName: string;
  password: string;
  mobile: string;
  captcha: string;
}

export async function getAllCommunity(params: LoginParamsType) {
  return request('/tos/tosCommunity/get', {
    method: 'POST',
    data: params,
  });
}

export async function fakeAccountLogin(params: LoginParamsType) {
  return request('/api/tos/user/login/', {
    method: 'POST',
    data: params,
  });
}

export async function logoutAccount() {
  return request('/api/users/logout/', {
    method: 'POST',
  });
}

export async function getFakeCaptcha(mobile: string) {
  return request(`/api/login/captcha?mobile=${mobile}`);
}
