/*
 * @Author: your name
 * @Date: 2021-06-23 23:15:24
 * @LastEditTime: 2021-06-25 00:09:09
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \Mina_B_T\miniprogram\service\hwUser.ts
 */
import api from "../api/api";
import { $request } from "../utils/request";

export const getHwUserInfoApi = (): Promise<responseOptions> => {
  const options: requestOptionsType<any> = {
    url: api.hwUser.getHwUserInfo,
  };
  return $request(options);
};

export const bannerApi = (): Promise<responseOptions> => {
  const options: requestOptionsType<any> = {
    url: api.hwUser.banner,
  };
  return $request(options);
};

/**
 * 获取验证码
 * @param data 
 */
export const getAuthCodeApi = (data: getAuthCodeDataType): Promise<responseOptions> => {
  const options: requestOptionsType<any> = {
    url: api.hwuser.getAuthCode,
    data
  };
  return $request(options)
};

/**
 * 电话登陆
 * @param data 
 */
export const phoneLoginApi = (data: phoneLoginDataType): Promise<responseOptions> => {
  const options: requestOptionsType<any> = {
    url: api.hwuser.phoneLogin,
    data,
    type: 'post'
  }
  return $request(options)
}