Skip to content

Commit

Permalink
fix: incomplete albums and artists in library (qier222#765) qier222#704
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaogaozi authored Jun 11, 2021
1 parent dd315e5 commit 12cae1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/api/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
});
Expand All @@ -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(),
},
});
Expand All @@ -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(),
},
});
Expand Down
4 changes: 2 additions & 2 deletions src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down

0 comments on commit 12cae1b

Please sign in to comment.