diff --git a/.prettierignore b/.prettierignore index 3502ba4..5446648 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,5 @@ build coverage dist -NeteaseCloudMusicApi-master -NeteaseCloudMusicApi-master.zip +napi diff --git a/src/api/mv.js b/src/api/mv.js index d00b095..f294785 100644 --- a/src/api/mv.js +++ b/src/api/mv.js @@ -13,6 +13,7 @@ export function mvDetail(mvid) { method: "get", params: { mvid, + timestamp: new Date().getTime(), }, }); } @@ -27,7 +28,6 @@ export function mvDetail(mvid) { * @param {number} params.id * @param {number=} params.r */ - export function mvUrl(params) { return request({ url: "/mv/url", @@ -35,6 +35,7 @@ export function mvUrl(params) { params, }); } + /** * 相似 mv * 说明 : 调用此接口 , 传入 mvid 可获取相似 mv @@ -47,3 +48,22 @@ export function simiMv(mvid) { params: { mvid }, }); } + +/** + * 收藏/取消收藏 MV + * 说明 : 调用此接口,可收藏/取消收藏 MV + * - mvid: mv id + * - t: 1 为收藏,其他为取消收藏 + * @param {Object} params + * @param {number} params.mvid + * @param {number=} params.t + */ + +export function likeAMV(params) { + params.timestamp = new Date().getTime(); + return request({ + url: "/mv/sub", + method: "post", + params, + }); +} diff --git a/src/components/MvRow.vue b/src/components/MvRow.vue index d26c50a..477ca9c 100644 --- a/src/components/MvRow.vue +++ b/src/components/MvRow.vue @@ -74,7 +74,7 @@ export default { artistName = mv.creator[0].userName; artistID = mv.creator[0].userId; } - return `${artistName}`; + return `${artistName}`; } else if (this.subtitle === "publishTime") { return mv.publishTime; } diff --git a/src/locale/lang/en.js b/src/locale/lang/en.js index f43b6a1..659d2f2 100644 --- a/src/locale/lang/en.js +++ b/src/locale/lang/en.js @@ -35,6 +35,8 @@ export default { withAlbums: "Albums", artist: "Artist", videos: "Music Videos", + following: "Following", + follow: "Follow" }, album: { released: "Released", diff --git a/src/locale/lang/zh-CN.js b/src/locale/lang/zh-CN.js index 2dd4dad..4839267 100644 --- a/src/locale/lang/zh-CN.js +++ b/src/locale/lang/zh-CN.js @@ -32,6 +32,8 @@ export default { withAlbums: "张专辑", artist: "歌手", videos: "个MV", + following: "已关注", + follow: "关注" }, album: { released: "发行于", diff --git a/src/views/artist.vue b/src/views/artist.vue index b9d19e2..f32f03e 100644 --- a/src/views/artist.vue +++ b/src/views/artist.vue @@ -17,8 +17,8 @@ {{ $t("play") }} - Following - Follow + {{ $t("artist.following") }} + {{ $t("artist.follow") }} @@ -84,7 +84,7 @@
MVs
-
+
{{ $t("artist.EPsSingles") }}
- {{ mv.data.name }} +
{{ mv.data.playCount | formatPlayCount }} Views · @@ -26,17 +32,20 @@