@gt6/sdk 1.0.47 → 1.0.49
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
|
@@ -679,8 +679,10 @@ class ArticlesAPI {
|
|
|
679
679
|
filteredTotal: 0
|
|
680
680
|
};
|
|
681
681
|
}
|
|
682
|
+
// 将文章数据倒序排列
|
|
683
|
+
const reversedArticleIds = [...categoryData.articleIds].reverse();
|
|
682
684
|
// 应用搜索过滤
|
|
683
|
-
let filteredArticleIds =
|
|
685
|
+
let filteredArticleIds = reversedArticleIds.filter(articleObj => {
|
|
684
686
|
// 1. regionId 过滤
|
|
685
687
|
if (searchOptions?.regionIds && searchOptions.regionIds.length > 0) {
|
|
686
688
|
if (!articleObj.regionId || !searchOptions.regionIds.includes(articleObj.regionId)) {
|
|
@@ -1001,11 +1003,13 @@ class ArticlesAPI {
|
|
|
1001
1003
|
tag: tagInfo
|
|
1002
1004
|
};
|
|
1003
1005
|
}
|
|
1006
|
+
// 将文章ID列表倒序排列
|
|
1007
|
+
const reversedArticleIds = [...tagData.articleIds].reverse();
|
|
1004
1008
|
// 应用分页
|
|
1005
1009
|
const page = options?.page || 1;
|
|
1006
1010
|
const limit = options?.limit || 10;
|
|
1007
1011
|
const offset = (page - 1) * limit;
|
|
1008
|
-
const paginatedArticleIds =
|
|
1012
|
+
const paginatedArticleIds = reversedArticleIds.slice(offset, offset + limit);
|
|
1009
1013
|
// 获取文章详情
|
|
1010
1014
|
const articles = await Promise.all(paginatedArticleIds.map(articleId => this.getArticle_all(articleId)));
|
|
1011
1015
|
// 应用状态过滤
|