config.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. import { BannerRep } from "@/api/home";
  2. import { server } from "@/utils/client";
  3. type SwitchType = 1 | 2; // 1开启 2关闭
  4. export interface ConfigType {
  5. show_free_game: SwitchType;
  6. show_again_game: SwitchType;
  7. identity_verify: IdentityVerify;
  8. }
  9. export interface IdentityVerify {
  10. /**
  11. * 充值实名,1开启 2关闭
  12. */
  13. deposit: SwitchType;
  14. /**
  15. * 注册实名,1开启 2关闭
  16. */
  17. register: SwitchType;
  18. /**
  19. * 提现实名,1开启 2关闭
  20. */
  21. withdraw: SwitchType;
  22. }
  23. export const getConfigApi = async () => {
  24. return server
  25. .request<ConfigType>({
  26. url: "/v1/api/front/system/configs",
  27. method: "POST",
  28. })
  29. .then((res) => {
  30. return res.data;
  31. });
  32. };
  33. export const getShareApi = async (params: { channel_url: string }) => {
  34. return server.request({
  35. url: `/v1/api/user/channel/add_click`,
  36. method: "get",
  37. params,
  38. });
  39. };
  40. /**
  41. * @description
  42. * 获取邮箱联系列表
  43. * POST /v1/api/front/links/contacts
  44. * 接口ID:257797888
  45. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-257797888
  46. */
  47. export interface ContactType {
  48. /**
  49. * 邮箱地址
  50. */
  51. email: string;
  52. /**
  53. * 名称
  54. */
  55. name: string;
  56. /**
  57. * 侧边栏显示,1显示 2不显示
  58. */
  59. show_bar: SwitchType;
  60. /**
  61. * 首页显示,1显示 2不显示
  62. */
  63. show_home: SwitchType;
  64. }
  65. export const getContactsApi = async () => {
  66. return server.request<ContactType[]>({
  67. url: `/v1/api/front/links/contacts`,
  68. method: "POST",
  69. });
  70. };
  71. /**
  72. * @description
  73. * 获取侧边栏
  74. * POST /v1/api/front/sidebar
  75. * 接口ID:258235334
  76. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-258235334
  77. */
  78. export const getSidebarActivitiesApi = async () => {
  79. return server.request<BannerRep[]>({
  80. url: `/v1/api/front/sidebar`,
  81. method: "POST",
  82. });
  83. };