// 引入工具函数
import request from '@/common/request'

// 热门游戏（有参数）
export const getGameHot = (params:any) => {
  return request({
    url: '/game/hot',
    method: 'get',
    params
  })
}
export const getIndexGameHot = () => {
  return request({
    url: '/game/hot',
    method: 'get'
  })
}
// 游戏推荐（有参数）
export const getGameRecommand = (params:any) => {
  return request({
    url: '/game/recommand',
    method: 'get',
    params
  })
}
export const getIndexGameRecommand = () => {
  return request({
    url: '/game/recommand',
    method: 'get'
  })
}
// 游戏列表
export const getGameList = (params:any) => {
  return request({
    url: '/game/list',
    method: 'get',
    params
  })
}
export const getGameLis = () => {
  return request({
    url: '/game/list',
    method: 'get'
  })
}
// 用户登录
export const getUserLogin = (data:any) => {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}
// 我的游戏
export const getMineGame = (params:any) => {
  return request({
    url: '/game/mine',
    method: 'get',
    params
  })
}
// 游戏标签
export const getGameTag = () => {
  return request({
    url: '/game/tag',
    method: 'get'
  })
}
// 游戏类型
export const getGameType = () => {
  return request({
    url: '/game/type',
    method: 'get'
  })
}
// 验证码
export const getCaptchaHttp = <T>(data:T) => {
  return request({
    url: '/user/captcha',
    method: 'post',
    data
  })
}
// 验证码登录
export const captchaLogin = <T>(data:T) => {
  return request({
    url: 'user/captcha_login',
    method: 'post',
    data
  })
}
// 用户信息
export const userProfile = <T>(params:T) => {
  return request({
    url: 'user/profile',
    method: 'get',
    params
  })
}
// 更改密码
export const resetPassword = <T>(data:T) => {
  return request({
    url: '/user/reset_password',
    method: 'post',
    data
  })
}
// 更改密码
export const setPassword = <T>(data:T) => {
  return request({
    url: '/user/set_password',
    method: 'post',
    data
  })
}
// 用户名更改
export const userAccount = <T>(data:T) => {
  return request({
    url: '/user/account',
    method: 'post',
    data
  })
}
// 用户名更改
export const getGiftHttp = <T>(params:T) => {
  return request({
    url: '/game/gift',
    method: 'get',
    params
  })
}
export const receiveGiftHttp = <T>(data:T) => {
  return request({
    url: '/game/tera',
    method: 'post',
    data
  })
}
export const userOrder = <T>(params:T) => {
  return request({
    url: '/user/order',
    method: 'get',
    params
  })
}
export const userEcoin = <T>(params:T) => {
  return request({
    url: '/user/ecoin',
    method: 'get',
    params
  })
}
export const userNcoin = <T>(params:T) => {
  return request({
    url: '/user/ncoin',
    method: 'get',
    params
  })
}
export const unbindCaptcha = <T>(params?:T) => {
  return request({
    url: '/user/unbind_captcha',
    method: 'get',
    params
  })
}
export const clearMobile = <T>(data:T) => {
  return request({
    url: '/user/clear_mobile',
    method: 'post',
    data
  })
}
export const bindCaptcha = <T>(data:T) => {
  return request({
    url: '/user/bind_captcha',
    method: 'post',
    data
  })
}
export const bindMobile = <T>(data:T) => {
  return request({
    url: '/user/bind_mobile',
    method: 'post',
    data
  })
}
