From 12cae1b921ae973c9554bb959d45a3cb40fd45aa Mon Sep 17 00:00:00 2001 From: Changjian Gao Date: Fri, 11 Jun 2021 10:56:05 +0800 Subject: [PATCH] fix: incomplete albums and artists in library (#765) #704 --- src/api/user.js | 13 ++++++++----- src/store/actions.js | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/api/user.js b/src/api/user.js index b92c022..5caa95a 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -87,17 +87,18 @@ export function dailySignin(type = 0) { /** * 获取收藏的专辑(需要登录) * 说明 : 调用此接口可获取到用户收藏的专辑 - * - limit : 返回数量 , 默认为 30 - * - offset : 偏移数量,用于分页 , 如 :( 页数 -1)*30, 其中 30 为 limit 的值 , 默认为 0 + * - limit : 返回数量 , 默认为 25 + * - offset : 偏移数量,用于分页 , 如 :( 页数 -1)*25, 其中 25 为 limit 的值 , 默认为 0 * @param {Object} params * @param {number} params.limit * @param {number=} params.offset */ -export function likedAlbums() { +export function likedAlbums(params) { return request({ url: '/album/sublist', method: 'get', params: { + limit: params.limit, timestamp: new Date().getTime(), }, }); @@ -107,11 +108,12 @@ export function likedAlbums() { * 获取收藏的歌手(需要登录) * 说明 : 调用此接口可获取到用户收藏的歌手 */ -export function likedArtists() { +export function likedArtists(params) { return request({ url: '/artist/sublist', method: 'get', params: { + limit: params.limit, timestamp: new Date().getTime(), }, }); @@ -121,11 +123,12 @@ export function likedArtists() { * 获取收藏的MV(需要登录) * 说明 : 调用此接口可获取到用户收藏的MV */ -export function likedMVs() { +export function likedMVs(params) { return request({ url: '/mv/sublist', method: 'get', params: { + limit: params.limit, timestamp: new Date().getTime(), }, }); diff --git a/src/store/actions.js b/src/store/actions.js index 3c3b825..3053226 100644 --- a/src/store/actions.js +++ b/src/store/actions.js @@ -129,7 +129,7 @@ export default { }, fetchLikedArtists: ({ commit }) => { if (!isAccountLoggedIn()) return; - return likedArtists().then(result => { + return likedArtists({ limit: 2000 }).then(result => { if (result.data) { commit('updateLikedXXX', { name: 'artists', @@ -140,7 +140,7 @@ export default { }, fetchLikedMVs: ({ commit }) => { if (!isAccountLoggedIn()) return; - return likedMVs().then(result => { + return likedMVs({ limit: 2000 }).then(result => { if (result.data) { commit('updateLikedXXX', { name: 'mvs',