修改完成待测试

This commit is contained in:
2026-09-13 17:45:47 +08:00
parent 9ad572907b
commit bbc024f7f2
80 changed files with 3844 additions and 1672 deletions
+24 -1
View File
@@ -3,11 +3,33 @@ import {
normalizeComplianceDocument,
normalizeComplianceDocumentKey,
normalizeHelpArticles,
normalizePromotionPlacement
normalizePromotionPlacement,
normalizeSiteArticles
} from './site-content-contract.js'
import { requestStrict } from './request-client.js'
export const siteContentApi = {
async getSiteArticles(requestOptions = {}) {
const limit = requestOptions.limit ?? 20
if (!Number.isSafeInteger(limit) || limit < 1 || limit > 100) {
throw new TypeError('官网文章数量上限无效')
}
const articleType = typeof requestOptions.articleType === 'string'
? requestOptions.articleType.trim()
: ''
const articles = await requestStrict({
url: '/genealogy/app/site/articles',
method: 'GET',
data: {
limit,
...(articleType ? { articleType } : {})
}
}, {
requestController: requestOptions.requestController ?? null
})
return normalizeSiteArticles(articles)
},
async getHelpArticles(requestOptions = {}) {
const helpArticles = await requestStrict({
url: '/genealogy/app/help-articles',
@@ -25,6 +47,7 @@ export const siteContentApi = {
method: 'GET',
data: { platform: 'app', placement }
}, {
authenticated: false,
requestController: requestOptions.requestController ?? null
})
return normalizeAppPromotions(promotions, placement)