-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv.musicapi.development.ts
53 lines (53 loc) · 1.76 KB
/
env.musicapi.development.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import axios from 'axios';
const MusicApi = {
getLists: async (limit: number) => {
const url = `http://localhost:3000/personalized?limit=${limit}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
searchSong: async (keywords: string) => {
const url = `http://localhost:3000/search?keywords= ${keywords}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
getListDetails: async (id: number) => {
const url = `http://localhost:3000/playlist/detail?id=${id}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
getAllSongs: async (id: number) => {
const url = `http://localhost:3000/playlist/track/all?id=${id}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
getSongUrl: async (id: number) => {
const url = `http://localhost:3000/song/url?id=${id}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
getSongDetails: async (ids: string) => {
const url = `http://localhost:3000/song/detail?ids=${ids}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
getSongWord: async (id: number) => {
const url = `http://localhost:3000/lyric?id=${id}`;
const result: any = {};
const res = await axios({ url, withCredentials: true });
result.body = res.data;
return result;
},
};
export default MusicApi;