first commit

This commit is contained in:
qier222 2020-10-10 19:54:44 +08:00
commit e4ba16b9a2
102 changed files with 19066 additions and 0 deletions

22
src/api/album.js Normal file
View file

@ -0,0 +1,22 @@
import request from "@/utils/request";
export function getAlbum(id) {
return request({
url: "/album",
method: "get",
params: {
id,
},
});
}
export function newAlbums(params) {
// limit : 返回数量 , 默认为 30
// offset : 偏移数量,用于分页 , 如 :( 页数 -1)*30, 其中 30 为 limit 的值 , 默认为 0
// area : ALL:全部,ZH:华语,EA:欧美,KR:韩国,JP:日本
return request({
url: "/album/new",
method: "get",
params,
});
}

36
src/api/artist.js Normal file
View file

@ -0,0 +1,36 @@
import request from "@/utils/request";
export function getArtist(id) {
return request({
url: "/artists",
method: "get",
params: {
id,
},
});
}
export function getArtistAlbum(params) {
// 必选参数 : id: 歌手 id
// 可选参数 : limit: 取出数量 , 默认为 50
// offset: 偏移数量 , 用于分页 , 如 :( 页数 -1)*50, 其中 50 为 limit 的值 , 默认 为 0
return request({
url: "/artist/album",
method: "get",
params,
});
}
export function toplistOfArtists(type = null) {
// type : 地区
// 1: 华语
// 2: 欧美
// 3: 韩国
// 4: 日本
return request({
url: "/toplist/artist",
method: "get",
params: {
type,
},
});
}

9
src/api/others.js Normal file
View file

@ -0,0 +1,9 @@
import request from "@/utils/request";
export function search(params) {
return request({
url: "/search",
method: "get",
params,
});
}

65
src/api/playlist.js Normal file
View file

@ -0,0 +1,65 @@
import request from "@/utils/request";
export function recommendPlaylist(params) {
// limit: 取出数量 , 默认为 30
return request({
url: "/personalized",
method: "get",
params,
});
}
export function dailyRecommendPlaylist(params) {
// limit: 取出数量 , 默认为 30
return request({
url: "/recommend/resource",
method: "get",
params,
});
}
export function getPlaylistDetail(id) {
return request({
url: "/playlist/detail",
method: "get",
params: {
id,
},
});
}
export function highQualityPlaylist(params) {
// 可选参数: cat: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 "全部", 可从精品歌单标签列表接口获取(/playlist/highquality / tags)
// limit: 取出歌单数量 , 默认为 20
// before: 分页参数,取上一页最后一个歌单的 updateTime 获取下一页数据
return request({
url: "/top/playlist/highquality",
method: "get",
params,
});
}
export function topPlaylist(params) {
// 可选参数 : order: 可选值为 'new' 和 'hot', 分别对应最新和最热 , 默认为 'hot'
// cat:cat: tag, 比如 " 华语 "、" 古风 " 、" 欧美 "、" 流行 ", 默认为 "全部",可从歌单分类接口获取(/playlist/catlist)
// limit: 取出歌单数量 , 默认为 50
// offset: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)*50, 其中 50 为 limit 的值
return request({
url: "/top/playlist",
method: "get",
params,
});
}
export function playlistCatlist() {
return request({
url: "/playlist/catlist",
method: "get",
});
}
export function toplists() {
return request({
url: "/toplist",
method: "get",
});
}

47
src/api/track.js Normal file
View file

@ -0,0 +1,47 @@
import request from "@/utils/request";
export function getMP3(id) {
return request({
url: "/song/url",
method: "get",
params: {
id,
},
});
}
export function getTrackDetail(id) {
return request({
url: "/song/detail",
method: "get",
params: {
ids: id,
},
});
}
export function getLyric(id) {
return request({
url: "/lyric",
method: "get",
params: {
id: id,
},
});
}
export function topSong(type) {
// type: 地区类型 id,对应以下:
// 全部:0
// 华语:7
// 欧美:96
// 日本:8
// 韩国:16
return request({
url: "/top/song",
method: "get",
params: {
type,
},
});
}

43
src/api/user.js Normal file
View file

@ -0,0 +1,43 @@
import request from "@/utils/request";
export function login(params) {
// 必选参数 :
// phone: 手机号码
// password: 密码
// 可选参数 :
// countrycode: 国家码用于国外手机号登陆例如美国传入1
// md5_password: md5加密后的密码,传入后 password 将失效
return request({
url: "/login/cellphone",
method: "get",
params,
});
}
export function userDetail(uid) {
return request({
url: "/user/detail",
method: "get",
params: {
uid,
},
});
}
export function userPlaylist(params) {
// limit : 返回数量 , 默认为 30
// offset : 偏移数量,用于分页 , 如 :( 页数 -1)*30, 其中 30 为 limit 的值 , 默认为 0
return request({
url: "/user/playlist",
method: "get",
params,
});
}
export function userLikedSongsIDs(uid) {
return request({
url: "/likelist",
method: "get",
uid,
});
}