feat(health): 新增公开文章列表端点 /public/articles 供小程序访客首页使用
访客首页文章列表调用 /health/articles 需要 JWT 认证导致 401。 新增 GET /public/articles?tenant_id=xxx 端点,强制只返回已发布文章, 无需认证。小程序访客首页改用此公开端点。
This commit is contained in:
@@ -60,8 +60,8 @@ function GuestHome({ modeClass }: { modeClass: string }) {
|
||||
try {
|
||||
const [bannerData, articleData] = await Promise.allSettled([
|
||||
api.get<PublicBanner[]>('/public/banners', { tenant_id: tenantId }, 300_000),
|
||||
api.get<{ data: Article[]; total: number }>('/health/articles', {
|
||||
status: 'published',
|
||||
api.get<{ data: Article[]; total: number }>('/public/articles', {
|
||||
tenant_id: tenantId,
|
||||
page_size: 4,
|
||||
}, 300_000),
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user