home.ts 769 B

1234567891011121314151617181920212223242526272829
  1. import { type GetHotSpotListResponse, type GetSceneDetailResponse } from '@/types/home';
  2. import service from '@/utils/services';
  3. const SCENE_BASE_URL = 'https://count.4dage.com/api';
  4. export const homeApi = {
  5. getHotSpotList() {
  6. return service.get<GetHotSpotListResponse>(
  7. `${window.g_Prefix}/data/${window.number}/hot/js/data.js`
  8. );
  9. },
  10. getSceneDetail(sceneCode: string) {
  11. return service.get<GetSceneDetailResponse | null>(
  12. `${SCENE_BASE_URL}/count/detail/${sceneCode}`
  13. );
  14. },
  15. saveSceneVisit(sceneCode: string) {
  16. return service.get(`${SCENE_BASE_URL}/count/saveVisit/${sceneCode}`);
  17. },
  18. /**
  19. * 点赞
  20. */
  21. saveStar(sceneCode: string) {
  22. return service.get(`${SCENE_BASE_URL}/count/saveStar/${sceneCode}`);
  23. },
  24. };