@gt6/sdk 1.0.46 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/gt6-sdk.cjs.js
CHANGED
|
@@ -643,11 +643,13 @@ class ArticlesAPI {
|
|
|
643
643
|
limit: options?.limit || 10
|
|
644
644
|
};
|
|
645
645
|
}
|
|
646
|
+
// 将文章ID列表倒序排列
|
|
647
|
+
const reversedArticleIds = [...categoryData.articleIds].reverse();
|
|
646
648
|
// 应用分页
|
|
647
649
|
const page = options?.page || 1;
|
|
648
650
|
const limit = options?.limit || 10;
|
|
649
651
|
const offset = (page - 1) * limit;
|
|
650
|
-
const paginatedArticleIds =
|
|
652
|
+
const paginatedArticleIds = reversedArticleIds.slice(offset, offset + limit);
|
|
651
653
|
// 获取文章详情 - 修复:提取 articleId 字段
|
|
652
654
|
const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_all(articleId)));
|
|
653
655
|
// 应用状态过滤
|
|
@@ -804,7 +806,9 @@ class ArticlesAPI {
|
|
|
804
806
|
try {
|
|
805
807
|
const categoryData = await this.client.request(`/big-article-categories/${singleCategoryId}.json`);
|
|
806
808
|
if (categoryData && categoryData.articleIds && categoryData.articleIds.length > 0) {
|
|
807
|
-
|
|
809
|
+
// 将每个分类的文章数据倒序排列后再追加
|
|
810
|
+
const reversedArticleIds = [...categoryData.articleIds].reverse();
|
|
811
|
+
allArticleData.push(...reversedArticleIds);
|
|
808
812
|
totalArticles += categoryData.articleIds.length;
|
|
809
813
|
}
|
|
810
814
|
}
|