解决下载和页面分页问题
This commit is contained in:
@@ -55,12 +55,15 @@ class ArtistService {
|
||||
`/v1/user/illusts?${stringify(params)}`
|
||||
);
|
||||
|
||||
console.log('Artworks response keys:', Object.keys(response));
|
||||
console.log('Artworks count:', response.illusts?.length || 0);
|
||||
console.log('Next URL:', response.next_url);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
data: {
|
||||
artworks: response.illusts,
|
||||
next_url: response.next_url,
|
||||
total: response.illusts.length
|
||||
next_url: response.next_url
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -774,6 +774,9 @@ class DownloadService {
|
||||
allArtworks.push(...artworks);
|
||||
offset += artworks.length;
|
||||
|
||||
// 基于 next_url 判断是否还有更多页面
|
||||
hasMore = !!artworksResult.data.next_url;
|
||||
|
||||
// 添加延迟避免请求过于频繁
|
||||
await new Promise(resolve => setTimeout(resolve, 500));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user