import { post, get,instance } from "@/utils/request";

enum URL {
  // 手机号登录
  login = "/mobileLogin",
  // 手机号注册
  register = '/mobileReg',
  // 用户详情
  userInfo = "/getMyInfo",
  // 重置密码
  restPassword = '/mobileRestPwd',
  // 获取验证码
  mobileCode = '/getMobileVCode',
  // google登录
  googleLogin = '/googleLogin',
  // 绑定手机
  bindMobile = '/bindMobile',
  //获取头像列表
  getHeadList = 'getHeadList',
  //修改头像
  modifyHead = 'modifyHead',
  // 修改名字
  modifyNickName = 'modifyNickname',
  //验证手机
  verifyMobile = 'verifyMobile',
  // 修改密码
  pwdRestPwd = 'pwdRestPwd',
  // 收藏
  favorGame = 'favorGame',
  // 取消收藏
  cancelFavorGame = 'cancelFavorGame',

  getVipLvInfo='getVipAward',
  checkNewNotice='checkNewNotice',
  checkNewMail='checkNewMail',
  getCycleRebate='getCycleRebate',
  useGiftCode = '/useGiftCode',
}

export const useGiftCode = async (data: any) => {
  return await instance(URL.useGiftCode, {
    method: 'post',
    headers: {
      "Content-Type": "application/json"
    },
    data: data,
  })
};

export const getCycleRebate = (data: any) => post(URL.getCycleRebate, data);
export const login = (data: any) => post(URL.login, data);

export const register = (data: any) => post(URL.register, data);

export const userInfo = () => post(URL.userInfo);

export const restPassword = (data: any) => post(URL.restPassword, data);

export const mobileCode = (data: any) => post(URL.mobileCode, data);

export const pwdRestPwd = (data: any) => post(URL.pwdRestPwd, data);

export const googleLogin = (data: any) => post(URL.googleLogin, data);

export const bindMobile = (data: any) => post(URL.bindMobile, data);

export const modifyHead = (data: any) => post(URL.modifyHead, data);

export const verifyMobile = (data: any) => post(URL.verifyMobile, data);

export const modifyNickName = (data: any) => post(URL.modifyNickName, data);

export const favorGame = (data: any) => post(URL.favorGame, data);

export const cancelFavorGame = (data: any) => post(URL.cancelFavorGame, data);

export const getHeadList = () => post(URL.getHeadList);

export const getVipLvInfo = (data: any) => post(URL.getVipLvInfo, data);
export const checkNewNotice = (data: any) => post(URL.checkNewNotice, data);
export const checkNewMail = (data: any) => post(URL.checkNewMail, data);



