import request from '@/utils/request';

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

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

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

export async function AccountLogin(params: LoginParamsType) {
  console.log('登录请求');
  console.log(params);
  return request('/tos/user/login', { method: 'POST', data: params });
}

export async function AccountOut() {
  return request('/tos/user/login', { method: 'POST' });
}
export interface LoginCheckParamsType {
  userName: string;
  password: string;
  userLevel: string;
  userId: string;
}
export async function AccountCheckLogin(params: LoginCheckParamsType) {
  console.log('登录确认请求');
  return request('/tos/user/newCurrentUser', { method: 'POST', data: params });
}
