index.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // 引入工具函数
  2. import request from '@/common/request'
  3. // 热门游戏(有参数)
  4. export const getGameHot = (params:any) => {
  5. return request({
  6. url: '/game/hot',
  7. method: 'get',
  8. params
  9. })
  10. }
  11. export const getIndexGameHot = () => {
  12. return request({
  13. url: '/game/hot',
  14. method: 'get'
  15. })
  16. }
  17. // 游戏推荐(有参数)
  18. export const getGameRecommand = (params:any) => {
  19. return request({
  20. url: '/game/recommand',
  21. method: 'get',
  22. params
  23. })
  24. }
  25. export const getIndexGameRecommand = () => {
  26. return request({
  27. url: '/game/recommand',
  28. method: 'get'
  29. })
  30. }
  31. // 游戏列表
  32. export const getGameList = (params:any) => {
  33. return request({
  34. url: '/game/list',
  35. method: 'get',
  36. params
  37. })
  38. }
  39. export const getGameLis = () => {
  40. return request({
  41. url: '/game/list',
  42. method: 'get'
  43. })
  44. }
  45. // 用户登录
  46. export const getUserLogin = (data:any) => {
  47. return request({
  48. url: '/user/login',
  49. method: 'post',
  50. data
  51. })
  52. }
  53. // 我的游戏
  54. export const getMineGame = (params:any) => {
  55. return request({
  56. url: '/game/mine',
  57. method: 'get',
  58. params
  59. })
  60. }
  61. // 游戏标签
  62. export const getGameTag = () => {
  63. return request({
  64. url: '/game/tag',
  65. method: 'get',
  66. })
  67. }
  68. // 游戏类型
  69. export const getGameType = () => {
  70. return request({
  71. url: '/game/type',
  72. method: 'get',
  73. })
  74. }